If with no sleep, child_3 will preempt and get the lock before child_2 some time. It may fail the test case.
Signed-off-by: Wanlong Gao <[email protected]> --- .../conformance/interfaces/sem_post/8-1.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c index 165b094..37ed8a3 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c @@ -174,6 +174,7 @@ int main() } fprintf(stderr, "P: child_2: %d forked\n", c_2); + sleep(1); /* Make sure the two children has been waiting */ /*do { sleep(1); @@ -254,4 +255,4 @@ clean_up: sem_unlink(semname); sem_unlink(semname_1); return retval; -} \ No newline at end of file +} -- 1.7.6 ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
