comparison src/os/solaris/vm/threadCritical_solaris.cpp @ 1490:f03d0a26bf83

6888954: argument formatting for assert() and friends Reviewed-by: kvn, twisti, apetrusenko, never, dcubed
author jcoomes
date Thu, 22 Apr 2010 13:23:15 -0700
parents a61af66fc99e
children c18cbe5936b8
comparison
equal deleted inserted replaced
1489:cff162798819 1490:f03d0a26bf83
45 ThreadCritical::ThreadCritical() { 45 ThreadCritical::ThreadCritical() {
46 if (initialized) { 46 if (initialized) {
47 thread_t owner = thr_self(); 47 thread_t owner = thr_self();
48 if (global_mut_owner != owner) { 48 if (global_mut_owner != owner) {
49 if (os::Solaris::mutex_lock(&global_mut)) 49 if (os::Solaris::mutex_lock(&global_mut))
50 fatal1("ThreadCritical::ThreadCritical: mutex_lock failed (%s)", strerror(errno)); 50 fatal(err_msg("ThreadCritical::ThreadCritical: mutex_lock failed (%s)",
51 strerror(errno)));
51 assert(global_mut_count == 0, "must have clean count"); 52 assert(global_mut_count == 0, "must have clean count");
52 assert(global_mut_owner == -1, "must have clean owner"); 53 assert(global_mut_owner == -1, "must have clean owner");
53 } 54 }
54 global_mut_owner = owner; 55 global_mut_owner = owner;
55 ++global_mut_count; 56 ++global_mut_count;
64 assert(global_mut_count > 0, "must have correct count"); 65 assert(global_mut_count > 0, "must have correct count");
65 --global_mut_count; 66 --global_mut_count;
66 if (global_mut_count == 0) { 67 if (global_mut_count == 0) {
67 global_mut_owner = -1; 68 global_mut_owner = -1;
68 if (os::Solaris::mutex_unlock(&global_mut)) 69 if (os::Solaris::mutex_unlock(&global_mut))
69 fatal1("ThreadCritical::~ThreadCritical: mutex_unlock failed (%s)", strerror(errno)); 70 fatal(err_msg("ThreadCritical::~ThreadCritical: mutex_unlock failed "
71 "(%s)", strerror(errno)));
70 } 72 }
71 } else { 73 } else {
72 assert (Threads::number_of_threads() == 0, "valid only during initialization"); 74 assert (Threads::number_of_threads() == 0, "valid only during initialization");
73 } 75 }
74 } 76 }