Changeset 6a6e205 for tests/concurrency/pthread
- Timestamp:
- Jan 13, 2025, 1:32:32 PM (3 weeks ago)
- Branches:
- master
- Children:
- c086c6e
- Parents:
- 267b543
- Location:
- tests/concurrency/pthread
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/pthread/bounded_buffer.cfa
r267b543 r6a6e205 126 126 exit( EXIT_FAILURE ); 127 127 } // if 128 if ( (uint64_t)result != 0) {128 if ( result != 0p ) { 129 129 sout | "producers" | prods[i] |" bad return value " | result; 130 130 exit( EXIT_FAILURE ); … … 142 142 exit( EXIT_FAILURE ); 143 143 } // if 144 if ( (uint64_t)result != 0) {144 if ( result != 0p ) { 145 145 sout| "consumers bad return value" | result; 146 146 exit( EXIT_FAILURE ); -
tests/concurrency/pthread/pthread_demo_lock.cfa
r267b543 r6a6e205 15 15 // unlocked increnment 16 16 void* inc_unlock(void* cnt){ 17 for ( int i = 0; i < (uint64_t)cnt; i++){17 for (uintptr_t i = 0; i < (uintptr_t)cnt; i++){ 18 18 cnt_nolock++; 19 19 } // for … … 23 23 void* inc_lock(void* cnt){ 24 24 pthread_mutex_lock(&_mutex); 25 for ( int i = 0; i < (uint64_t)cnt; i++){25 for (uintptr_t i = 0; i < (uintptr_t)cnt; i++){ 26 26 cnt_lock++; 27 27 } // for … … 73 73 sout | "in trylocktest2 res2 is" | res; 74 74 pthread_mutex_lock(&_mutex); 75 for ( int i = 0; i < (uint64_t)arg; i++) cnt_trylock++;75 for (uintptr_t i = 0; i < (uintptr_t)arg; i++) cnt_trylock++; 76 76 pthread_mutex_unlock(&_mutex); 77 77 return NULL; … … 87 87 88 88 // inc cnt then release the lock 89 for ( int i = 0; i < (uint64_t)arg; i++) cnt_trylock++;89 for (uintptr_t i = 0; i < (uintptr_t)arg; i++) cnt_trylock++; 90 90 pthread_mutex_unlock(&_mutex); 91 91 pthread_mutex_unlock(&_mutex); … … 113 113 114 114 115 int main( int argc, char const *argv[])115 int main() 116 116 { 117 117 -
tests/concurrency/pthread/pthread_once_test.cfa
r267b543 r6a6e205 74 74 75 75 if (thread_stat[i] != 0) 76 printf("bad thread status, thread %d, status=% d\n", i+1,77 ( int)thread_stat[i]);76 printf("bad thread status, thread %d, status=%zu\n", i+1, 77 (size_t)thread_stat[i]); 78 78 } 79 79
Note: See TracChangeset
for help on using the changeset viewer.