File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1059,14 +1059,16 @@ pub extern "C" fn temporal_core_complete_async_reserve(
10591059 let permit_id =
10601060 NonZero :: new ( permit_id) . expect ( "permit_id cannot be 0 on successful reservation" ) ;
10611061 let prev_state = unsafe {
1062+ // Not turning completion_ctx into Arc yet as we only want to deallocate it on success
10621063 ( * completion_ctx) . state . compare_exchange (
10631064 SlotReserveOperationState :: Pending ,
10641065 SlotReserveOperationState :: Completed ( permit_id) ,
10651066 )
10661067 } ;
10671068 match prev_state {
10681069 Ok ( _) => {
1069- drop ( unsafe { Arc :: from_raw ( completion_ctx) } ) ;
1070+ let completion_ctx = unsafe { Arc :: from_raw ( completion_ctx) } ;
1071+ completion_ctx. notify . notify_one ( ) ;
10701072 true
10711073 }
10721074 Err ( SlotReserveOperationState :: Cancelled ) => false ,
You can’t perform that action at this time.
0 commit comments