Pretty good, but you should translate the example into pthread_*()
interfaces rather than the legacy thr_*() Solaris threads interfaces.
You are right, theoretically.
However, on all versions of Solaris in existence, the flag will
become visible within a short time (at least milliseconds).
In Solaris 10, you could use one of the atomic add functions.
In the future, there will be more atomic operations, including
memory barriers, to deal with more relaxed memory models that
may/will come along.