Can I implement pthread_cleanup_push without a macro?
I was about to use pthread_cleanup_push, when I noticed that it is implemented as a macro (on Solraris 2.5) which forces you to have the pthread_cleanup_pop in the same function by having an open brace { at the end of the first macro and closing it int the second… Since I want to hide most of this stuff in something like a monitor (or a guard in ACE) in C++ by using the push in a constructor and the pop in the destructor I’m wondering if there is something fondamental that would prevent me to do so or could I just re-implement the stuff done by the macros inside some class services. POSIX 1003.1c-1995 specifies that pthread_cleanup_push and pthread_cleanup_pop must be used at the same lexical scope, “as if” the former were a macro that expands to include an opening brace (“{“) and the latter were a macro that expands to include the matching closing brace (“}”). The Solaris 2.5 definition therefore conforms quite accurately to the intent of the standard. And so does the Digital UNIX d