instance constructor sets stationary member, thread safe?
i am re-factoring formula am wondering a lock
instance constructor.
public category myclass {
private stationary int32 opposing = 0;
private int32 mycount;
open myclass() {
lock(this) {
counter++;
mycount = counter;
}
}
}
please confirm
- instance constructors thread-safe.
- the close matter prevents opening formula block, stationary 'counter' member.
if vigilant uncanny programmer have any instance know the 'count', i synchronize opening 'counter' member pledge another thread isn't new'ing myclass
changing count before sets the count?
fyi - category singleton. instances contingency simply wakeful number.
Comments
Post a Comment