@@ -890,6 +890,7 @@ void DefaultActorImpl::giveUpThread(RunningJobInfo runner) {
890
890
auto firstNewJob = preprocessQueue (oldState.FirstJob , JobRef (), nullptr ,
891
891
overridesToWake);
892
892
893
+ _swift_tsan_release (this );
893
894
while (true ) {
894
895
State newState = oldState;
895
896
newState.FirstJob = JobRef::getPreprocessed (firstNewJob);
@@ -929,7 +930,6 @@ void DefaultActorImpl::giveUpThread(RunningJobInfo runner) {
929
930
// Try again.
930
931
continue ;
931
932
}
932
- _swift_tsan_release (this );
933
933
934
934
#if SWIFT_TASK_PRINTF_DEBUG
935
935
# define LOG_STATE_TRANSITION fprintf (stderr, " %p transition from %zx to %zx in %p.%s\n " , \
@@ -1069,6 +1069,7 @@ Job *DefaultActorImpl::claimNextJobOrGiveUp(bool actorIsOwned,
1069
1069
nullptr , overridesToWake);
1070
1070
1071
1071
Optional<JobPriority> remainingJobPriority;
1072
+ _swift_tsan_release (this );
1072
1073
while (true ) {
1073
1074
State newState = oldState;
1074
1075
@@ -1112,11 +1113,6 @@ Job *DefaultActorImpl::claimNextJobOrGiveUp(bool actorIsOwned,
1112
1113
}
1113
1114
LOG_STATE_TRANSITION;
1114
1115
1115
- if (jobToRun)
1116
- _swift_tsan_acquire (this );
1117
- else
1118
- _swift_tsan_release (this );
1119
-
1120
1116
// We successfully updated the state.
1121
1117
1122
1118
// If we're giving up the thread with jobs remaining, we need
0 commit comments