History log of /external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dadab74ec5c36fe26ea6ebd788196051e8130da6 23-Feb-2016 Jan Stancek <jstancek@redhat.com> open_posix: condvar/schedule: remove signal handlers

POSIX states:
"It is not safe to use the pthread_cond_signal() function in a signal
handler that is invoked asynchronously. Even if it were safe, there
would still be a race between the test of the Boolean pthread_cond_wait()
that could not be efficiently eliminated."

Further, this test could hang on single CPU, if signal gets delivered
to main thread, because there is low prio thread busy looping with
higher priority than main.

This patch removes signal handlers and instead uses main to
signal/unlock condition/barrier/mutex that high prio thread is
blocked on.

High and low prio threads are set to run on same CPU to check that
high prio thread really preempted low prio thread regarless of number
of CPUs on system. Main thread's priority is at least the same as
low prio thread, therefore it should eventually run even if there
is only single CPU on system.

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
0f029d9eea2b580cd4389aecb50f016b7d5fdc04 19-Feb-2016 Jan Stancek <jstancek@redhat.com> open_posix: condvar/schedule: remove duplicit setsched calls

pthread_attr_setschedparam's man page says:
In order for the parameter setting made by pthread_attr_setschedparam()
to have effect when calling pthread_create(3), the caller must use
pthread_attr_setinheritsched(3) to set the inherit-scheduler attribute
of the attributes object attr to PTHREAD_EXPLICIT_SCHED.

So add PTHREAD_EXPLICIT_SCHED to attr used during pthread_create and
remove duplicit pthread_setsched calls in each thread.

Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
d9d0e9cc0cd3f5eb5f70d47177a4b9ed4a0de827 18-Feb-2016 Jan Stancek <jstancek@redhat.com> open_posix: condvar/schedule: remove useless waiting

If high prio thread wakes up, test is done, there's no point waiting
another 3 seconds for low prio thread to end its busy loop.

If test PASS-es, we save 3 seconds per test.

Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
061df0771e1e4c42dc6d0f1efabe38b9392de48e 18-Feb-2016 Jan Stancek <jstancek@redhat.com> open_posix: condvar/schedule: use SAFE_PFUNC

Replace common error checking with SAFE_PFUNC macro. Also remove
some obvious comments.

Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
354ebb48db8e66a853a58379a4808d5dcd1ceac3 07-Dec-2012 Wanlong Gao <gaowanlong@cn.fujitsu.com> cleanup code indent

Cleanup the code indent using:

find . -name *.c -exec Lindent {} \;

It's really a big change, but can fix almost all of
the indent problem in C code, although we can't
ensure all of the changes are right, but the error
changes are really few.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
ec6edca7aa42b6affd989ef91b5897f96795e40f 18-Oct-2012 Chris Dearman <chris@mips.com> Add missing newline at end of file

This is a scripted change done using the following command:

find . -type d -name .git -prune -o \
-type f \! -name \*\~ \! -name .\#\* \
\! -name \*.gz \! -name \*.pdf \! -name \*.patch -print0 | \
xargs -0 sed -i -e '$a\'

Signed-off-by: Chris Dearman <chris@mips.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
de55e5ac14dc3e683117ae84bad34944fa7c38c6 19-Aug-2011 Cyril Hrubis <chrubis@suse.cz> Unify the test passed messages.

Some of the tests printed "Test PASS" and some "Test PASSED" let's unify
this on "Test PASSED".

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
2c28215423293e443469a07ae7011135d058b671 16-Dec-2010 Garrett Cooper <yanegomi@gmail.com> Style and conformance changes.

1. Strip all leading space.
2. Move tst_exit() to main().
3. Remove tst_exit() from cleanup().
4. Remove cluebat comments.
5. Reduce some unnecessary whitespace.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
df3eb16e38c6a163b0a7367c885679eed6140964 29-Nov-2010 Garrett Cooper <yanegomi@gmail.com> Deal with a lot of annoying style nits.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
0dc076565f772bb1953209fb69ea150b494aaa40 03-Jun-2005 robbiew <robbiew> Updated the open_posix_testsuite:
------------------------------------------
June 3, 2005 Version 1.5.1 Released

* PTS-1.5.1 has a plenty of AIO interface test additions and bug-fixes
by Sebastien Decugis. Also there are a lot of bug fixes by other people.
Thanks to
Sebastien Decugis and other people for continued support and
contributions.

* This release has been tested on glibc-2.3.3 and kernel 2.6.10 with
libposix-aio-0.3.
The test result for this release can be found here:
http://posixtest.sourceforge.net/testpass/PTS_1.5.1-2.6.10-PAIO_ia32.htm


* PTS Downloads and Release information:
https://sourceforge.net/project/showfiles.php?group_id=64592&release_id=
332108
PTS Notes and Changelog:
https://sourceforge.net/project/shownotes.php?release_id=332108

Thanks
Ling Yu
POSIX Test Suite maintainer
http://posixtest.sf.net
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
19b5dc744e2b73f745491e5a081873f6c1417528 03-Jun-2005 robbiew <robbiew> Removed old version of Open POSIX Test Suite (OPTS).
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c
4d9d72ceb25b2b25541973aa0c4bb56474a28a41 06-Jul-2004 robbiew <robbiew> Updated to Posixtestsuite-1.4.3
/external/ltp/testcases/open_posix_testsuite/functional/threads/condvar/pthread_cond_wait_1.c