File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1025,11 +1025,11 @@ remove_counter(CounterObject *counter)
10251025
10261026 memset (counter , 0 , sizeof (CounterObject ));
10271027 -- shm_semlock_counters .header -> n_semlocks ;
1028- /* ---
1028+ /* --- */
10291029 if (shm_semlock_counters .header -> n_semlocks == 0 ) {
10301030 res = delete_shm_semlock_counters (false);
10311031 }
1032- -- */
1032+ /* -- */
10331033 return res ;
10341034}
10351035
@@ -1535,14 +1535,18 @@ semlock_dealloc(SemLockObject* self)
15351535 SEM_CLOSE (self -> handle_mutex );
15361536 }
15371537
1538- ACQUIRE_GLOCK ;
1539- DEBUG_PID_FUNC (self -> name , self -> handle_mutex , self -> counter , "" );
1540- -- self -> counter -> n_instances ;
1541- if (self -> counter && (self -> created || !self -> counter -> n_instances )) {
1542- res = remove_counter (self -> counter );
1543- self -> counter = NULL ;
1538+ if (ACQUIRE_GLOCK ) {
1539+ DEBUG_PID_FUNC (self -> name , self -> handle_mutex , self -> counter , "" );
1540+ if (self -> counter ) {
1541+ DEBUG_PID_FUNC (self -> name , self -> handle_mutex , self -> counter , "decref counter" );
1542+ -- self -> counter -> n_instances ;
1543+ if (!self -> counter -> n_instances ) {
1544+ res = remove_counter (self -> counter );
1545+ self -> counter = NULL ;
1546+ }
1547+ }
1548+ RELEASE_GLOCK ;
15441549 }
1545- RELEASE_GLOCK ;
15461550 if (!res ) {
15471551 delete_glock ();
15481552 }
You can’t perform that action at this time.
0 commit comments