Excessive locking in Speaker::fire()

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
cologic
Programmer
Posts: 337
Joined: 2003-01-06 13:32
Contact:

Excessive locking in Speaker::fire()

Post by cologic » 2003-02-24 17:39

As far as I can tell, Speaker::fire doesn't actually modify the listeners list, and given that STLport is thread-safe for read-only stuff, I fail to undertand why there are locks around all the variants of fire(). (As opposed to addListener, removeListener, and removeAllListeners or whatever they're called, which are justifiably locked.)

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-02-25 06:08

another thread could remove/add a listener which would modify the structures? That's the first thing I come to think of, but probably not the last...you're welcome to investigate further, it might as well be a remnant of old code...

cologic
Programmer
Posts: 337
Joined: 2003-01-06 13:32
Contact:

Post by cologic » 2003-03-30 22:14

Apparently removing the locks doesn't work too well, as there are some crashes that are pretty clearly the result of their absence in BCDC++. Oh well.

Locked