-
Notifications
You must be signed in to change notification settings - Fork 39
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
Request response streaming #860
base: RequestResponseBinding
Are you sure you want to change the base?
Conversation
mqttRequestResponseClientSubmitRequest(getNativeHandle(), request, future); | ||
this.handleReadLock.lock(); | ||
try { | ||
mqttRequestResponseClientSubmitRequest(getNativeHandle(), request, future); |
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.
With new locks, it's still possible that getNativeHandle()
returns 0 here. Java_software_amazon_awssdk_crt_iot_MqttRequestResponseClient_mqttRequestResponseClientSubmitRequest
should check for NULL, but currently it doesn't.
* native -> Java in the same call stack. This is true for both the request response client and streaming | ||
* operations, allowing us to add this layer of safety. | ||
*/ | ||
private final ReentrantReadWriteLock handleLock = new ReentrantReadWriteLock(); |
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.
Why reentrant lock? Creating new operations and closing the client can't call each unless I missed something.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.