HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OP_NodeCookLockedExecute.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: OP_NodeCookLockedExecute.h (OP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __OP_NODECOOKLOCKED_EXECUTE_H_INCLUDED__
12 #define __OP_NODECOOKLOCKED_EXECUTE_H_INCLUDED__
13 
14 #include <EXPR/EXPR_Lock.h>
15 
16 template <typename F>
17 inline void
18 OP_Node::cookLockedExecute(const F &functor)
19 {
21  [&]()
22  {
23  OP_CookLock::Scope scope(myCookLock);
24  functor();
25  });
26 #if H_BUILD_PARALLEL_COOK_MODE
27  if (isOperatorThreadSafe())
28  EXPR_StaticLock::theStaticCounter.add(-1);
29 #endif
30 }
31 
32 #endif // __OP_NODECOOKLOCKED_EXECUTE_H_INCLUDED__
void cookLockedExecute(const F &functor)
void lockedExecute(const F &functor)
Definition: UT_TaskLock.h:303
EXPR_API EXPR_GlobalStaticLock & ev_GlobalEvalLock()
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)