HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 
21 // Modify this to enable/disable parm expr locking
22 #define EXPR_LOCKS 1
23 
24 #if EXPR_LOCKS
27 #else
28  typedef UT_NullLock EXPR_Lock;
30 #endif
31 
33 
34 /// The global evaluation lock is a global mutex for protecting any
35 /// non-threadsafe evaluation (both expressions and node) code. This is
36 /// necessary to guard against code that might access global objects.
38 
39 #endif // __EXPR_LOCK_H_INCLUDED__
UT_TBBSpinLock EXPR_Lock
Definition: EXPR_Lock.h:25
UT_TaskLockWithArena EXPR_GlobalStaticLock
Definition: EXPR_Lock.h:26
EXPR_Lock::Scope EXPR_AutoLock
Definition: EXPR_Lock.h:32
UT_TaskLock that avoids deadlocks when used with TBB task scheduling.
Definition: UT_TaskLock.h:285
EXPR_API EXPR_GlobalStaticLock & ev_GlobalEvalLock()
#define EXPR_API
Definition: EXPR_API.h:10