Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Sep 26, 2024
1 parent 06fb206 commit ed04764
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/darwin/dispatch_queue_event_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ struct dispatch_loop {
struct aws_linked_list cross_thread_tasks;
struct aws_mutex lock;
bool suspended;
// `is_executing` flag and `current_thread_id` together are used to identify the excuting thread id for dispatch queue.
// `is_executing` flag and `current_thread_id` together are used to identify the excuting
// thread id for dispatch queue. See `static bool s_is_on_callers_thread(struct aws_event_loop *event_loop)`
// for details.
bool is_executing;
aws_thread_id_t current_thread_id;
} synced_data;
Expand Down Expand Up @@ -505,8 +507,9 @@ static int s_unsubscribe_from_io_events(struct aws_event_loop *event_loop, struc
static bool s_is_on_callers_thread(struct aws_event_loop *event_loop) {
struct dispatch_loop *dispatch_queue = event_loop->impl_data;
aws_mutex_lock(&dispatch_queue->synced_data.lock);
bool result = dispatch_queue->synced_data.is_executing &&
aws_thread_thread_id_equal(dispatch_queue->synced_data.current_thread_id, aws_thread_current_thread_id());
bool result =
dispatch_queue->synced_data.is_executing &&
aws_thread_thread_id_equal(dispatch_queue->synced_data.current_thread_id, aws_thread_current_thread_id());
aws_mutex_unlock(&dispatch_queue->synced_data.lock);
return result;
}

0 comments on commit ed04764

Please sign in to comment.