1 kumpf 1.13 //%/////////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 kumpf 1.13 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.2 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 kumpf 1.13 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10 mike 1.2 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
|
13 kumpf 1.13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
16 kumpf 1.13 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
19 mike 1.2 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 //==============================================================================
23 //
24 // Author: Mike Day (mdday@us.ibm.com)
25 //
26 // Modified By:
|
27 ramnath 1.10 // Ramnath Ravindran (Ramnath.Ravindran@compaq.com)
|
28 mike 1.2 //
29 //%/////////////////////////////////////////////////////////////////////////////
30
31
32 //%// ---- inline implmentations of Unix/Linux IPC routines ----
33
34 #ifndef IPCUnix_inline_h
35 #define IPCUnix_inline_h
36
|
37 mday 1.12
38
39
40
41
|
42 mike 1.2 // the next two routines are macros that MUST SHARE the same stack frame
43 // they are implemented as macros by glibc.
44 // native_cleanup_push( void (*func)(void *) ) ;
45 // these ALSO SET CANCEL STATE TO DEFER
46
|
47 mike 1.3 /*
48 ** For platforms which support these non-portable thread cleanup routines,
49 **
50 ** pthread_cleanup_push_defer_np
51 ** pthread_cleanup_pop_restore_np
52 **
53 ** We define the following:
54 */
|
55 mike 1.2
|
56 mday 1.12
|
57 chuck 1.17 #if !defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) && !defined(PEGASUS_PLATFORM_SOLARIS_SPARC_GNU) && !defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) && !defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) && !defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM)
|
58 mike 1.3 # define PEGASUS_HAVE_NP_THREAD_CLEANUP_ROUTINES
59 #endif
60
61 /*
62 **
63 ** Define native_cleanup_push() and native_cleanup_pop().
64 **
65 */
66
67 #ifdef PEGASUS_HAVE_NP_THREAD_CLEANUP_ROUTINES
68 # define native_cleanup_push(func, arg) \
69 pthread_cleanup_push_defer_np((func), arg)
70 # define native_cleanup_pop(execute) \
71 pthread_cleanup_pop_restore_np(execute)
72 #else
|
73 sage 1.4 #ifndef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
|
74 mike 1.3 # define native_cleanup_push(func, arg) \
75 { \
76 int _oldtype_; \
77 pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &_oldtype_); \
78 pthread_cleanup_push((func), arg);
79 # define native_cleanup_pop(execute) \
80 pthread_cleanup_pop(execute); \
81 pthread_setcanceltype(_oldtype_, NULL); \
82 }
|
83 sage 1.4 #else
84 // zOS special dish of the day
85 # define native_cleanup_push(func, arg) \
86 { \
87 int _oldtype_; \
88 _oldtype_ = pthread_setintrtype(PTHREAD_INTR_CONTROLLED); \
89 pthread_cleanup_push((func), arg);
90 # define native_cleanup_pop(execute) \
91 pthread_cleanup_pop(execute); \
92 _oldtype_ = pthread_setintrtype(_oldtype_); \
93 }
94 #endif
|
95 mike 1.3 #endif
|
96 mike 1.2
97
98 #endif // IPCUnix_inline_h
|