pmmp / ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
Other
82 stars 15 forks source link

Fixed connecting to an object whose creator no longer references it #127

Closed dktapps closed 1 year ago

dktapps commented 1 year ago

Due to some old code intended to avoid duplicated connections, we would try to connect directly to the original object from the thread that created the object, rather than the thread which gave us the object. This is problematic, since the creator thread might no longer reference the object, although it could still (evidently) exist on other threads.

We no longer need to track the original object, since we keep a list of the connection associated with each thread-safe object per thread, so duplicate connections should not happen anymore.

/cc @cooldogedev