1
/* $Xorg: ThreadsI.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ */
3
/************************************************************
4
Copyright 1993 by Sun Microsystems, Inc. Mountain View, CA.
8
Permission to use, copy, modify, and distribute this
9
software and its documentation for any purpose and without
10
fee is hereby granted, provided that the above copyright no-
11
tice appear in all copies and that both that copyright no-
12
tice and this permission notice appear in supporting docu-
13
mentation, and that the name Sun not be used in advertising
14
or publicity pertaining to distribution of the software
15
without specific prior written permission. Sun makes no
16
representations about the suitability of this software for
17
any purpose. It is provided "as is" without any express or
20
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
21
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
22
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
23
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
24
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
25
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
27
THE USE OR PERFORMANCE OF THIS SOFTWARE.
29
********************************************************/
33
Copyright 1994, 1998 The Open Group
35
Permission to use, copy, modify, distribute, and sell this software and its
36
documentation for any purpose is hereby granted without fee, provided that
37
the above copyright notice appear in all copies and that both that
38
copyright notice and this permission notice appear in supporting
41
The above copyright notice and this permission notice shall be included in
42
all copies or substantial portions of the Software.
44
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
48
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
49
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
Except as contained in this notice, the name of The Open Group shall not be
52
used in advertising or otherwise to promote the sale, use or other dealings
53
in this Software without prior written authorization from The Open Group.
56
/* $XFree86: xc/lib/Xt/ThreadsI.h,v 3.5 2001/12/14 19:56:31 dawes Exp $ */
63
typedef struct _LockRec *LockPtr;
65
typedef void (*ThreadAppProc)(
66
#if NeedFunctionPrototypes
67
XtAppContext /* app */
71
typedef void (*ThreadAppYieldLockProc)(
72
#if NeedFunctionPrototypes
73
XtAppContext, /* app */
74
Boolean*, /* push_thread */
75
Boolean*, /* pushed_thread */
80
typedef void (*ThreadAppRestoreLockProc)(
81
#if NeedFunctionPrototypes
82
XtAppContext /* app */,
84
Boolean* /* pushed_thread */
88
extern void (*_XtProcessLock)(
89
#if NeedFunctionPrototypes
94
extern void (*_XtProcessUnlock)(
95
#if NeedFunctionPrototypes
100
extern void (*_XtInitAppLock)(
101
#if NeedFunctionPrototypes
102
XtAppContext /* app */
106
#define INIT_APP_LOCK(app) if(_XtInitAppLock) (*_XtInitAppLock)(app)
107
#define FREE_APP_LOCK(app) if(app && app->free_lock)(*app->free_lock)(app)
109
#define LOCK_PROCESS if(_XtProcessLock)(*_XtProcessLock)()
110
#define UNLOCK_PROCESS if(_XtProcessUnlock)(*_XtProcessUnlock)()
111
#define LOCK_APP(app) if(app && app->lock)(*app->lock)(app)
112
#define UNLOCK_APP(app) if(app && app->unlock)(*app->unlock)(app)
114
#define YIELD_APP_LOCK(app,push,pushed,level)\
115
if(app && app->yield_lock) (*app->yield_lock)(app,push,pushed,level)
116
#define RESTORE_APP_LOCK(app,level,pushed)\
117
if(app && app->restore_lock) (*app->restore_lock)(app,level,pushed)
119
#define WIDGET_TO_APPCON(w) \
120
XtAppContext app = (w && _XtProcessLock ? \
121
XtWidgetToApplicationContext(w) : NULL)
123
#define DPY_TO_APPCON(d) \
124
XtAppContext app = (_XtProcessLock ? XtDisplayToApplicationContext(d): 0)
126
#else /* defined(XTHREADS) */
129
#define UNLOCK_PROCESS
130
#define LOCK_APP(app)
131
#define UNLOCK_APP(app)
133
#define INIT_APP_LOCK(app)
134
#define FREE_APP_LOCK(app)
136
#define WIDGET_TO_APPCON(w)
137
#define DPY_TO_APPCON(d)
139
#endif /* !defined(XTHREADS) */
140
#endif /* _XtThreadsI_h */