-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grand dispatch queue #661
base: runtime_select_event_loop
Are you sure you want to change the base?
Grand dispatch queue #661
Changes from all commits
9389f14
e825924
452217c
c0d4086
84fd773
98c8ef0
89e8ece
9c27144
f375bb2
41a5fa1
04c2b93
0d301d2
4afaea6
a7f6904
89635db
195ca1c
24ce65b
287094f
bd58da0
f0e5dde
aef1b14
41bb257
22e68b2
a28cb37
c67e966
3ca34ce
f8c26f5
a428cd8
5ab8f24
0918e76
a55f14f
06fb206
ed04764
e8fe46d
a84cb5a
977bb8a
ce07c5a
0210346
a751d76
b44c510
b0f85f2
7bc39ee
475c1f2
cf592a7
1803c0f
977c4f7
eab14fa
55de953
74019cf
5d22a69
600421e
f808b35
4a8007a
70008b1
8bd9808
8d946db
1212977
afd634d
6b92e59
94f95c1
22c6363
c507d13
c54b99e
69cbb09
5fc5270
7d20796
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,20 @@ AWS_PUSH_SANE_WARNING_LEVEL | |
|
||
#define AWS_C_IO_PACKAGE_ID 1 | ||
|
||
struct aws_io_handle; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aws_io_handle should be moved to a private header. I don't see any references outside aws-c-io |
||
|
||
typedef void aws_io_set_queue_on_handle_fn(struct aws_io_handle *handle, void *queue); | ||
typedef void aws_io_clear_queue_on_handle_fn(struct aws_io_handle *handle); | ||
|
||
struct aws_io_handle { | ||
union { | ||
int fd; | ||
/* on Apple systems, handle is of type nw_connection_t. On Windows, it's a SOCKET handle. */ | ||
void *handle; | ||
} data; | ||
void *additional_data; | ||
aws_io_set_queue_on_handle_fn *set_queue; | ||
aws_io_clear_queue_on_handle_fn *clear_queue; | ||
}; | ||
|
||
enum aws_io_message_type { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#ifndef AWS_IO_PRIVATE_DISPATCH_QUEUE_H | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this header necessary? Does everything in it need to be visible? I would make the guard symbol AWS_IO_DARWIN_DISPATCH_QUEUE_H if it stays |
||
#define AWS_IO_PRIVATE_DISPATCH_QUEUE_H | ||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0. | ||
*/ | ||
|
||
#include <Security/Security.h> | ||
#include <aws/common/mutex.h> | ||
#include <aws/common/thread.h> | ||
#include <aws/io/tls_channel_handler.h> | ||
#include <dispatch/dispatch.h> | ||
|
||
struct secure_transport_ctx { | ||
struct aws_tls_ctx ctx; | ||
CFAllocatorRef wrapped_allocator; | ||
CFArrayRef certs; | ||
SecIdentityRef secitem_identity; | ||
CFArrayRef ca_cert; | ||
enum aws_tls_versions minimum_version; | ||
struct aws_string *alpn_list; | ||
bool verify_peer; | ||
}; | ||
|
||
struct dispatch_scheduling_state { | ||
/** | ||
* Let's us skip processing an iteration task if one is already in the middle of executing | ||
*/ | ||
bool is_executing_iteration; | ||
|
||
/** | ||
* List<scheduled_service_entry> in sorted order by timestamp | ||
* | ||
* When we go to schedule a new iteration, we check here first to see | ||
* if our scheduling attempt is redundant | ||
*/ | ||
struct aws_linked_list scheduled_services; | ||
}; | ||
|
||
struct dispatch_loop { | ||
struct aws_allocator *allocator; | ||
struct aws_ref_count ref_count; | ||
dispatch_queue_t dispatch_queue; | ||
struct aws_task_scheduler scheduler; | ||
struct aws_linked_list local_cross_thread_tasks; | ||
|
||
/* Apple dispatch queue uses the id string to identify the dispatch queue */ | ||
struct aws_string *dispatch_queue_id; | ||
|
||
struct { | ||
struct dispatch_scheduling_state scheduling_state; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the different between |
||
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. 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; | ||
|
||
bool is_destroying; | ||
}; | ||
|
||
#endif /* #ifndef AWS_IO_PRIVATE_DISPATCH_QUEUE_H */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What needs this in downstream libraries? Tests can access private headers.