Skip to content

Commit 44bbe6a

Browse files
committed
[SourceKit] Set RequestBarriersEnabled as early as possible
We were only setting `RequestBarriersEnabled` after dispatching the request to `requestQueue`. This left a brief gap where new requests could come in that wouldn’t see `RequestBarriersEnabled = true`.
1 parent 857a6c3 commit 44bbe6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/SourceKit/tools/sourcekitd/bin/XPC/Service/XPCService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ static void sourcekitdServer_peer_event_handler(xpc_connection_t peer,
278278
};
279279

280280
if (sourcekitd::requestIsEnableBarriers(req)) {
281+
RequestBarriersEnabled = true;
281282
dispatch_barrier_async(requestQueue, ^{
282283
auto Responder = std::make_shared<XPCResponder>(event, peer);
283284
xpc_release(event);
284-
RequestBarriersEnabled = true;
285285
sourcekitd::sendBarriersEnabledResponse([Responder](sourcekitd_response_t response) {
286286
Responder->sendReply(response);
287287
});

0 commit comments

Comments
 (0)