Jelajahi Sumber

prefer mlockfile

David Marec 11 bulan lalu
induk
melakukan
b29c9b8a85
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      testTimer/timerTest.c

+ 2 - 2
testTimer/timerTest.c

@@ -44,10 +44,10 @@ sigHandler(int signo, siginfo_t * si, void * /* ucontext_t */ uap)
 			/* timer timeout */
 			SLIST_FOREACH(np, &head, entries) {
 				if (np && np->code == si->si_value.sival_int) {
-					flock(1, LOCK_EX);
+					flockfile(stdout);
 					printf("%s", np->name);
 					fflush(stdout);
-					flock(1, LOCK_UN);
+					funlockfile(stdout);
 					break;
 				}
 			}