spinettaro / delphi-event-bus

Delphi Event Bus (for short DEB) is an Event Bus framework for Delphi
Apache License 2.0
466 stars 110 forks source link

Maybe a potential issue related to thread safety? #2

Closed edwinyzh closed 6 years ago

edwinyzh commented 8 years ago

I shared this simply-designed event bus library in the Delphi G+ group, here: https://plus.google.com/115143382472228750230/posts/ewvvesqjCb7

Some people reported that there might be a thread-safe with the TEventBus.GetDefault: singleton implementation, I thought I should post it here :)

As I said, the usage of this library is very clean and elegant, I'm definitely will use it in my projects :)

spinettaro commented 8 years ago

I'm reading the conversation that you have linked and yes, the GetDefault is to be reviewed. Thank you for sharing library with positive emphasis :) . It's an open source project so any help is welcome: If you want to test some part of the internal architecture you can do it by adding the specific Test. If the test fails we can consider a solution. As mentioned in a post of conversation: "Since it's a github project, you can file bugs or fix the threading issue and make a pull request." .

edwinyzh commented 8 years ago

I definitely will report any issues I might encounter, or provide fixes, if there will be any :)

spinettaro commented 8 years ago

Added a little fix to CriticalSection in the GetDefault method ( the code was unclear also for me :) ). Before I close the issue, I want to review all the thread-safety implementation .