33 static atomic<do_once_state> concmon_module_inited;
35 void WINAPI init_binsem_using_event( SRWLOCK* h_ )
37 srwl_or_handle* shptr = (srwl_or_handle*) h_;
38 shptr->h = CreateEventEx( NULL, NULL, 0, EVENT_ALL_ACCESS|SEMAPHORE_ALL_ACCESS );
41 void WINAPI acquire_binsem_using_event( SRWLOCK* h_ )
43 srwl_or_handle* shptr = (srwl_or_handle*) h_;
44 WaitForSingleObjectEx( shptr->h, INFINITE, FALSE );
47 void WINAPI release_binsem_using_event( SRWLOCK* h_ )
49 srwl_or_handle* shptr = (srwl_or_handle*) h_;
53 static void (WINAPI *__TBB_init_binsem)( SRWLOCK* ) = (
void (WINAPI *)(SRWLOCK*))&init_binsem_using_event;
54 static void (WINAPI *__TBB_acquire_binsem)( SRWLOCK* ) = (
void (WINAPI *)(SRWLOCK*))&acquire_binsem_using_event;
55 static void (WINAPI *__TBB_release_binsem)( SRWLOCK* ) = (
void (WINAPI *)(SRWLOCK*))&release_binsem_using_event;
59 DLD(InitializeSRWLock, __TBB_init_binsem),
60 DLD(AcquireSRWLockExclusive, __TBB_acquire_binsem),
61 DLD(ReleaseSRWLockExclusive, __TBB_release_binsem)
64 inline void init_concmon_module()
66 __TBB_ASSERT( (uintptr_t)__TBB_init_binsem==(uintptr_t)&init_binsem_using_event, NULL );
68 __TBB_ASSERT( (uintptr_t)__TBB_init_binsem!=(uintptr_t)&init_binsem_using_event, NULL );
69 __TBB_ASSERT( (uintptr_t)__TBB_acquire_binsem!=(uintptr_t)&acquire_binsem_using_event, NULL );
70 __TBB_ASSERT( (uintptr_t)__TBB_release_binsem!=(uintptr_t)&release_binsem_using_event, NULL );
77 __TBB_init_binsem( &
my_sem.lock );
78 if( (uintptr_t)__TBB_init_binsem!=(uintptr_t)&init_binsem_using_event )
83 if( (uintptr_t)__TBB_init_binsem==(uintptr_t)&init_binsem_using_event )
#define DLD(s, h)
The helper to construct dynamic_link_descriptor structure.
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Association between a handler name and location of pointer to it.
OPEN_INTERNAL_NAMESPACE bool dynamic_link(const char *, const dynamic_link_descriptor *, size_t, dynamic_link_handle *handle, int)
void atomic_do_once(const F &initializer, atomic< do_once_state > &state)
One-time initialization function.