Is C#'s using statement abort-safe?-Collection of common programming errors

Are authors of the book right and the using statement is not abort-safe or are they wrong and it behaves like in my second solution?

According to the book (p. 856), ThreadAbortException can be thrown anywhere in managed code. But maybe there are exceptions and the first variant is abort-safe after all?

The authors are right. The using block is not abort-safe. Your second solution is also not abort-safe, the thread could be aborted in the middle of the resource acquisition.

Although it’s not abort-safe, any disposable that has unmanged resources should also implement a finalizer, which will eventually run and clean up the resource. The finalizer should be robust enough to also take care of not completely initialized objects, in case the thread aborts in the middle of the resource acquisition.

A Thread.Abort will only wait for code running inside Constrained Execution Regions (CERs), finally blocks, catch blocks, static constructors, and unmanaged code. So this is an abort-safe solution (only regarding the acquisition and disposal of the resource):

StreamReader reader = null;
try {
  try { }
  finally { reader = File.OpenText("file.txt"); }
  // ...
}
finally {
  if (reader != null) reader.Dispose();
}

But be careful, abort-safe code should run fast and not block. It could hang a whole app domain unload operation.

If using is equivalent to the first variant (not abort-safe), why does it check for null in finally?

Checking for null makes the using pattern safe in the presence of null references.