lhotari commented on PR #16125: URL: https://github.com/apache/pulsar/pull/16125#issuecomment-1188296636
> @lhotari The `data` array object mutation only happens in the code path `put() -> expandArray()`, where `put()` acquires the `tailLock`, and `expandArray()` acquires the `headLock`. So the `data` array object should be thread safe if you acquires either `tailLock` or `headLock` before accessing the object. `data` array elements are mutated and read with 2 different locks in the methods in `GrowableArrayBlockingQueue` class. For example, `poll` is guarded by `headLock` and `put` is guarded by `tailLock`. I don't see how that could be thread safe. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
