File tree Expand file tree Collapse file tree 3 files changed +0
-66
lines changed
Expand file tree Collapse file tree 3 files changed +0
-66
lines changed Original file line number Diff line number Diff line change @@ -861,32 +861,6 @@ os_mutex_drop(OS_Handle mutex)
861861 pthread_mutex_unlock (& entity -> mutex_handle );
862862}
863863
864- internal OS_Handle
865- os_shared_mutex_alloc (String8 name )
866- {
867- NotImplemented ;
868- OS_Handle handle = {0 };
869- return handle ;
870- }
871-
872- internal void
873- os_shared_mutex_release (OS_Handle mutex )
874- {
875- NotImplemented ;
876- }
877-
878- internal B32
879- os_shared_mutex_take (OS_Handle mutex , U64 endt_us )
880- {
881- NotImplemented ;
882- }
883-
884- internal void
885- os_shared_mutex_drop (OS_Handle mutex )
886- {
887- NotImplemented ;
888- }
889-
890864//- rjf: reader/writer mutexes
891865
892866internal OS_Handle
Original file line number Diff line number Diff line change @@ -277,12 +277,6 @@ internal void os_rw_mutex_drop_r(OS_Handle mutex);
277277internal void os_rw_mutex_take_w (OS_Handle mutex );
278278internal void os_rw_mutex_drop_w (OS_Handle mutex );
279279
280- //- shared mutex
281- internal OS_Handle os_shared_mutex_alloc (String8 name );
282- internal void os_shared_mutex_release (OS_Handle mutex );
283- internal B32 os_shared_mutex_take (OS_Handle mutex , U64 endt_us );
284- internal void os_shared_mutex_drop (OS_Handle mutex );
285-
286280//- rjf: condition variables
287281internal OS_Handle os_condition_variable_alloc (void );
288282internal void os_condition_variable_release (OS_Handle cv );
Original file line number Diff line number Diff line change @@ -1106,40 +1106,6 @@ os_mutex_drop(OS_Handle mutex)
11061106 LeaveCriticalSection (& entity -> mutex );
11071107}
11081108
1109- internal OS_Handle
1110- os_shared_mutex_alloc (String8 name )
1111- {
1112- Assert (name .size );
1113- Temp scratch = scratch_begin (0 ,0 );
1114- String16 name16 = str16_from_8 (scratch .arena , name );
1115- HANDLE handle = CreateMutexW (0 , 0 , (WCHAR * )name16 .str );
1116- Assert (handle != 0 );
1117- OS_Handle mutex = {(U64 )handle };
1118- scratch_end (scratch );
1119- return mutex ;
1120- }
1121-
1122- internal void
1123- os_shared_mutex_release (OS_Handle mutex )
1124- {
1125- CloseHandle ((HANDLE )mutex .u64 [0 ]);
1126- }
1127-
1128- internal B32
1129- os_shared_mutex_take (OS_Handle mutex , U64 endt_us )
1130- {
1131- U32 sleep_ms = os_w32_sleep_ms_from_endt_us (endt_us );
1132- DWORD wait_result = WaitForSingleObject ((HANDLE )mutex .u64 [0 ], sleep_ms );
1133- B32 result = (wait_result == WAIT_OBJECT_0 );
1134- return result ;
1135- }
1136-
1137- internal void
1138- os_shared_mutex_drop (OS_Handle mutex )
1139- {
1140- ReleaseMutex ((HANDLE )mutex .u64 [0 ]);
1141- }
1142-
11431109//- rjf: reader/writer mutexes
11441110
11451111internal OS_Handle
You can’t perform that action at this time.
0 commit comments