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




  1. instance constructors thread-safe.

  2. 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

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members