HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EXPR_Lock.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: EXPR_Lock.h (EXPR Library, C++)
7  *
8  * COMMENTS: This header allows us to enable/disable locking when evaluating
9  * parameters and hscript expressions.
10  */
11 
12 #ifndef __EXPR_LOCK_H_INCLUDED__
13 #define __EXPR_LOCK_H_INCLUDED__
14 
15 #include "EXPR_API.h"
16 
17 #include <UT/UT_LockUtil.h>
18 #include <UT/UT_TaskLock.h>
19 #include <UT/UT_TBBSpinLock.h>
20 #include <SYS/SYS_AtomicInt.h>
21 #include <SYS/SYS_Types.h>
22 
23 // Modify this to enable/disable parm expr locking
24 #define EXPR_LOCKS 1
25 
27 
28 #if EXPR_LOCKS
31 #else
32  typedef UT_NullLock EXPR_Lock;
34 #endif
35 
37 
38 /// The global evaluation lock is a global mutex for protecting any
39 /// non-threadsafe evaluation (both expressions and node) code. This is
40 /// necessary to guard against code that might access global objects.
42 
43 #endif // __EXPR_LOCK_H_INCLUDED__
EXPR_StaticLock EXPR_GlobalStaticLock
Definition: EXPR_Lock.h:30
UT_TBBSpinLock EXPR_Lock
Definition: EXPR_Lock.h:29
EXPR_Lock::Scope EXPR_AutoLock
Definition: EXPR_Lock.h:36
UT_TaskLockWithArena EXPR_StaticLock
Definition: EXPR_Lock.h:26
UT_TaskLock that avoids deadlocks when used with TBB task scheduling.
Definition: UT_TaskLock.h:293
EXPR_API EXPR_GlobalStaticLock & ev_GlobalEvalLock()
#define EXPR_API
Definition: EXPR_API.h:10