![]() ![]() ![]() But, will also sometimes deadlock, depending on what the thread was doing at the time. Calling unsafe functions, like NSLog, will sometimes work. If you check out "man sigaction" (note, sigaction is a much improved API over signal) you see that there are actually a very small number of functions that are safe to call from a signal handler. This is an part of a class of problems known as "async safety". Examples of things that hold locks - malloc/free, the Objective-C runtime. Second, signals interrupt a thread, and that thread can be doing anything, including holding locks. There are other, legitimate uses of signals, and installing handlers will negatively impact their behavior without very careful work. Unfortunately, there are, in fact, some major issues with the suggested approach.įirst, signal handlers are per-process. Major credit goes to for putting work in here to come up with an answer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |