<ahref="testmtx_8c.html">Go to the documentation of this file.</a><divclass="fragment"><preclass="fragment"><aname="l00001"></a>00001 <spanclass="comment">/*</span>
<aname="l00027"></a>00027 <spanclass="preprocessor">#include "<aclass="code"href="ch_8h.html"title="ChibiOS/RT main include file.">ch.h</a>"</span>
<aname="l00028"></a>00028 <spanclass="preprocessor">#include "<aclass="code"href="test_8h.html"title="Tests support header.">test.h</a>"</span>
<aname="l00100"></a>00100 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00101"></a>00101 }
<aname="l00102"></a>00102
<aname="l00103"></a>00103 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread1(<spanclass="keywordtype">void</span> *p) {
<aname="l00104"></a>00104
<aname="l00105"></a>00105 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00106"></a>00106 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(*(<spanclass="keywordtype">char</span> *)p);
<aname="l00107"></a>00107 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00113"></a>00113 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio = <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>(); <spanclass="comment">// Because priority inheritance.</span>
<aname="l00114"></a>00114 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00115"></a>00115 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, prio+1, thread1, <spanclass="stringliteral">"E"</span>);
<aname="l00116"></a>00116 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, prio+2, thread1, <spanclass="stringliteral">"D"</span>);
<aname="l00117"></a>00117 threads[2] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[2], WA_SIZE, prio+3, thread1, <spanclass="stringliteral">"C"</span>);
<aname="l00118"></a>00118 threads[3] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[3], WA_SIZE, prio+4, thread1, <spanclass="stringliteral">"B"</span>);
<aname="l00119"></a>00119 threads[4] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[4], WA_SIZE, prio+5, thread1, <spanclass="stringliteral">"A"</span>);
<aname="l00120"></a>00120 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00121"></a>00121 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00122"></a>00122 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(1, prio == <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>(), <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00126"></a>00126 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx1 = {
<aname="l00172"></a>00172 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00176"></a>00176 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread2L(<spanclass="keywordtype">void</span> *p) {
<aname="l00177"></a>00177
<aname="l00178"></a>00178 (void)p;
<aname="l00179"></a>00179 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00181"></a>00181 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00183"></a>00183 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'C'</span>);
<aname="l00187"></a>00187 <spanclass="comment">/* Medium priority thread */</span>
<aname="l00188"></a>00188 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread2M(<spanclass="keywordtype">void</span> *p) {
<aname="l00189"></a>00189
<aname="l00190"></a>00190 (void)p;
<aname="l00191"></a>00191 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(20);
<aname="l00193"></a>00193 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'B'</span>);
<aname="l00197"></a>00197 <spanclass="comment">/* High priority thread */</span>
<aname="l00198"></a>00198 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread2H(<spanclass="keywordtype">void</span> *p) {
<aname="l00199"></a>00199
<aname="l00200"></a>00200 (void)p;
<aname="l00201"></a>00201 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(40);
<aname="l00202"></a>00202 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00204"></a>00204 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00205"></a>00205 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'A'</span>);
<aname="l00210"></a>00210 <aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> time;
<aname="l00211"></a>00211
<aname="l00212"></a>00212 <aclass="code"href="group__test.html#gac067dd7ee03b2c56d4d26ce9815ed3f7"title="Delays execution until next system time tick.">test_wait_tick</a>();
<aname="l00213"></a>00213 time = <aclass="code"href="group__time.html#ga137c8f67c450f34416a786d169be90e2"title="Current system time.">chTimeNow</a>();
<aname="l00214"></a>00214 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-1, thread2H, 0);
<aname="l00215"></a>00215 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-2, thread2M, 0);
<aname="l00216"></a>00216 threads[2] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[2], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-3, thread2L, 0);
<aname="l00217"></a>00217 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00219"></a>00219 <aclass="code"href="group__test.html#gabb18a77859d6fc0972a35d88f11a90e1"title="Test time window assertion.">test_assert_time_window</a>(2, time + <aclass="code"href="group__time.html#ga0a7e7bc6c6225bd9652c4f1567f1bc6a"title="Time conversion utility.">MS2ST</a>(100), time + <aclass="code"href="group__time.html#ga0a7e7bc6c6225bd9652c4f1567f1bc6a"title="Time conversion utility.">MS2ST</a>(100) + ALLOWED_DELAY);
<aname="l00220"></a>00220 }
<aname="l00221"></a>00221
<aname="l00222"></a>00222 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx2 = {
<aname="l00271"></a>00271 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread3LL(<spanclass="keywordtype">void</span> *p) {
<aname="l00272"></a>00272
<aname="l00273"></a>00273 (void)p;
<aname="l00274"></a>00274 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00276"></a>00276 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00277"></a>00277 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'E'</span>);
<aname="l00282"></a>00282 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread3L(<spanclass="keywordtype">void</span> *p) {
<aname="l00283"></a>00283
<aname="l00284"></a>00284 (void)p;
<aname="l00285"></a>00285 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(10);
<aname="l00286"></a>00286 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00288"></a>00288 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00290"></a>00290 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00292"></a>00292 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00293"></a>00293 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'D'</span>);
<aname="l00297"></a>00297 <spanclass="comment">/* Medium priority thread */</span>
<aname="l00298"></a>00298 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread3M(<spanclass="keywordtype">void</span> *p) {
<aname="l00299"></a>00299
<aname="l00300"></a>00300 (void)p;
<aname="l00301"></a>00301 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(20);
<aname="l00302"></a>00302 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00304"></a>00304 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00305"></a>00305 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'C'</span>);
<aname="l00309"></a>00309 <spanclass="comment">/* High priority thread */</span>
<aname="l00310"></a>00310 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread3H(<spanclass="keywordtype">void</span> *p) {
<aname="l00311"></a>00311
<aname="l00312"></a>00312 (void)p;
<aname="l00313"></a>00313 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(40);
<aname="l00315"></a>00315 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'B'</span>);
<aname="l00320"></a>00320 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread3HH(<spanclass="keywordtype">void</span> *p) {
<aname="l00321"></a>00321
<aname="l00322"></a>00322 (void)p;
<aname="l00323"></a>00323 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(50);
<aname="l00324"></a>00324 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00326"></a>00326 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00327"></a>00327 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(<spanclass="charliteral">'A'</span>);
<aname="l00332"></a>00332 <aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> time;
<aname="l00333"></a>00333
<aname="l00334"></a>00334 <aclass="code"href="group__test.html#gac067dd7ee03b2c56d4d26ce9815ed3f7"title="Delays execution until next system time tick.">test_wait_tick</a>();
<aname="l00335"></a>00335 time = <aclass="code"href="group__time.html#ga137c8f67c450f34416a786d169be90e2"title="Current system time.">chTimeNow</a>();
<aname="l00336"></a>00336 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-5, thread3LL, 0);
<aname="l00337"></a>00337 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-4, thread3L, 0);
<aname="l00338"></a>00338 threads[2] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[2], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-3, thread3M, 0);
<aname="l00339"></a>00339 threads[3] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[3], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-2, thread3H, 0);
<aname="l00340"></a>00340 threads[4] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[4], WA_SIZE, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>()-1, thread3HH, 0);
<aname="l00341"></a>00341 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00343"></a>00343 <aclass="code"href="group__test.html#gabb18a77859d6fc0972a35d88f11a90e1"title="Test time window assertion.">test_assert_time_window</a>(2, time + <aclass="code"href="group__time.html#ga0a7e7bc6c6225bd9652c4f1567f1bc6a"title="Time conversion utility.">MS2ST</a>(110), time + <aclass="code"href="group__time.html#ga0a7e7bc6c6225bd9652c4f1567f1bc6a"title="Time conversion utility.">MS2ST</a>(110) + ALLOWED_DELAY);
<aname="l00344"></a>00344 }
<aname="l00345"></a>00345
<aname="l00346"></a>00346 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx3 = {
<aname="l00370"></a>00370 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00371"></a>00371 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m2);
<aname="l00372"></a>00372 }
<aname="l00373"></a>00373
<aname="l00374"></a>00374 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread4a(<spanclass="keywordtype">void</span> *p) {
<aname="l00375"></a>00375
<aname="l00376"></a>00376 (void)p;
<aname="l00377"></a>00377 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(50);
<aname="l00378"></a>00378 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00379"></a>00379 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00383"></a>00383 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread4b(<spanclass="keywordtype">void</span> *p) {
<aname="l00384"></a>00384
<aname="l00385"></a>00385 (void)p;
<aname="l00386"></a>00386 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(150);
<aname="l00387"></a>00387 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00388"></a>00388 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00393"></a>00393 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> p, p1, p2;
<aname="l00394"></a>00394
<aname="l00395"></a>00395 p = <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>();
<aname="l00396"></a>00396 p1 = p + 1;
<aname="l00397"></a>00397 p2 = p + 2;
<aname="l00398"></a>00398 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, p1, thread4a, <spanclass="stringliteral">"B"</span>);
<aname="l00399"></a>00399 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, p2, thread4b, <spanclass="stringliteral">"A"</span>);
<aname="l00400"></a>00400 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00401"></a>00401 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(1, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00402"></a>00402 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(100);
<aname="l00403"></a>00403 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(2, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00404"></a>00404 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00405"></a>00405 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(3, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00406"></a>00406 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(100);
<aname="l00407"></a>00407 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(4, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p2, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00408"></a>00408 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00409"></a>00409 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(5, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00410"></a>00410 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(100);
<aname="l00411"></a>00411 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(6, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00412"></a>00412 <aclass="code"href="group__mutexes.html#ga853b4ced43d22fb5d82678dd2f0aba75"title="Unlocks all the mutexes owned by the invoking thread.">chMtxUnlockAll</a>();
<aname="l00413"></a>00413 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(7, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00414"></a>00414 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00415"></a>00415
<aname="l00416"></a>00416 <spanclass="comment">/* Test repeated in order to cover chMtxUnlockS().*/</span>
<aname="l00417"></a>00417 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, p1, thread4a, <spanclass="stringliteral">"D"</span>);
<aname="l00418"></a>00418 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, p2, thread4b, <spanclass="stringliteral">"C"</span>);
<aname="l00419"></a>00419 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00420"></a>00420 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(8, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00421"></a>00421 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(100);
<aname="l00422"></a>00422 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(9, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00423"></a>00423 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00424"></a>00424 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(10, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00425"></a>00425 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(100);
<aname="l00426"></a>00426 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(11, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p2, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00427"></a>00427 <aclass="code"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42"title="Enters the kernel lock mode.">chSysLock</a>();
<aname="l00428"></a>00428 <aclass="code"href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlockS</a>();
<aname="l00429"></a>00429 <aclass="code"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e"title="Leaves the kernel lock mode.">chSysUnlock</a>();
<aname="l00430"></a>00430 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(12, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00431"></a>00431 <aclass="code"href="group__threads.html#ga5aebc25e053a0094714abce4cad9f56f"title="Delays the invoking thread for the specified number of milliseconds.">chThdSleepMilliseconds</a>(100);
<aname="l00432"></a>00432 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(13, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p1, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00433"></a>00433 <aclass="code"href="group__mutexes.html#ga853b4ced43d22fb5d82678dd2f0aba75"title="Unlocks all the mutexes owned by the invoking thread.">chMtxUnlockAll</a>();
<aname="l00434"></a>00434 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(14, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == p, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00435"></a>00435 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00436"></a>00436 }
<aname="l00437"></a>00437
<aname="l00438"></a>00438 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx4 = {
<aname="l00461"></a>00461 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00465"></a>00465 <aclass="code"href="group__types.html#ga7556af1cb61728b53228fa3af1c851de"title="Boolean, recommended the fastest signed.">bool_t</a> b;
<aname="l00466"></a>00466 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio;
<aname="l00467"></a>00467
<aname="l00468"></a>00468 prio = <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>();
<aname="l00469"></a>00469
<aname="l00470"></a>00470 b = <aclass="code"href="group__mutexes.html#gaada14e216460dc55e1816234168cf95c"title="Tries to lock a mutex.">chMtxTryLock</a>(&m1);
<aname="l00473"></a>00473 b = <aclass="code"href="group__mutexes.html#gaada14e216460dc55e1816234168cf95c"title="Tries to lock a mutex.">chMtxTryLock</a>(&m1);
<aname="l00476"></a>00476 <aclass="code"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42"title="Enters the kernel lock mode.">chSysLock</a>();
<aname="l00477"></a>00477 <aclass="code"href="group__mutexes.html#ga705fa60fb8aa28a6632f693e83f78c96"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlockS</a>();
<aname="l00478"></a>00478 <aclass="code"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e"title="Leaves the kernel lock mode.">chSysUnlock</a>();
<aname="l00479"></a>00479
<aname="l00480"></a>00480 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(3, <aclass="code"href="group__internals.html#gadf402c10356566d82a6631c102b7f656"title="Evaluates to TRUE if the specified threads queue or list is empty.">isempty</a>(&m1.m_queue), <spanclass="stringliteral">"queue not empty"</span>);
<aname="l00482"></a>00482 <aclass="code"href="group__test.html#ga835cb17ca3869922b49435d95324a68b"title="Test assertion.">test_assert</a>(5, <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>() == prio, <spanclass="stringliteral">"wrong priority level"</span>);
<aname="l00483"></a>00483 }
<aname="l00484"></a>00484
<aname="l00485"></a>00485 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx5 = {
<aname="l00510"></a>00510 <aclass="code"href="group__condvars.html#ga4c698ba6ce06089c08f989e126af9873"title="Initializes s CondVar structure.">chCondInit</a>(&c1);
<aname="l00511"></a>00511 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00512"></a>00512 }
<aname="l00513"></a>00513
<aname="l00514"></a>00514 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread10(<spanclass="keywordtype">void</span> *p) {
<aname="l00515"></a>00515
<aname="l00516"></a>00516 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00517"></a>00517 <aclass="code"href="group__condvars.html#ga466f912bc9b09b133fae862993004ffe"title="Waits on the condition variable releasing the mutex lock.">chCondWait</a>(&c1);
<aname="l00518"></a>00518 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(*(<spanclass="keywordtype">char</span> *)p);
<aname="l00519"></a>00519 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00525"></a>00525 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio = <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>();
<aname="l00526"></a>00526 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, prio+1, thread10, <spanclass="stringliteral">"E"</span>);
<aname="l00527"></a>00527 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, prio+2, thread10, <spanclass="stringliteral">"D"</span>);
<aname="l00528"></a>00528 threads[2] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[2], WA_SIZE, prio+3, thread10, <spanclass="stringliteral">"C"</span>);
<aname="l00529"></a>00529 threads[3] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[3], WA_SIZE, prio+4, thread10, <spanclass="stringliteral">"B"</span>);
<aname="l00530"></a>00530 threads[4] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[4], WA_SIZE, prio+5, thread10, <spanclass="stringliteral">"A"</span>);
<aname="l00531"></a>00531 <aclass="code"href="group__system.html#ga9f6573c0763d1e4e97c63c62edad6e42"title="Enters the kernel lock mode.">chSysLock</a>();
<aname="l00532"></a>00532 <aclass="code"href="group__condvars.html#ga7b9d882c348124fed46a1afc3db6c02c"title="Signals one thread that is waiting on the condition variable.">chCondSignalI</a>(&c1);
<aname="l00533"></a>00533 <aclass="code"href="group__condvars.html#ga7b9d882c348124fed46a1afc3db6c02c"title="Signals one thread that is waiting on the condition variable.">chCondSignalI</a>(&c1);
<aname="l00534"></a>00534 <aclass="code"href="group__condvars.html#ga7b9d882c348124fed46a1afc3db6c02c"title="Signals one thread that is waiting on the condition variable.">chCondSignalI</a>(&c1);
<aname="l00535"></a>00535 <aclass="code"href="group__condvars.html#ga7b9d882c348124fed46a1afc3db6c02c"title="Signals one thread that is waiting on the condition variable.">chCondSignalI</a>(&c1);
<aname="l00536"></a>00536 <aclass="code"href="group__condvars.html#ga7b9d882c348124fed46a1afc3db6c02c"title="Signals one thread that is waiting on the condition variable.">chCondSignalI</a>(&c1);
<aname="l00537"></a>00537 <aclass="code"href="group__scheduler.html#ga4e38b4bee3d2330f6a0f1cdb7660af20"title="Performs a reschedule if a higher priority thread is runnable.">chSchRescheduleS</a>();
<aname="l00538"></a>00538 <aclass="code"href="group__system.html#ga5a257fa58a09815eb64a45e2dfbdc22e"title="Leaves the kernel lock mode.">chSysUnlock</a>();
<aname="l00539"></a>00539 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00543"></a>00543 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx6 = {
<aname="l00566"></a>00566 <aclass="code"href="group__condvars.html#ga4c698ba6ce06089c08f989e126af9873"title="Initializes s CondVar structure.">chCondInit</a>(&c1);
<aname="l00567"></a>00567 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00573"></a>00573 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio = <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>();
<aname="l00574"></a>00574 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, prio+1, thread10, <spanclass="stringliteral">"E"</span>);
<aname="l00575"></a>00575 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, prio+2, thread10, <spanclass="stringliteral">"D"</span>);
<aname="l00576"></a>00576 threads[2] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[2], WA_SIZE, prio+3, thread10, <spanclass="stringliteral">"C"</span>);
<aname="l00577"></a>00577 threads[3] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[3], WA_SIZE, prio+4, thread10, <spanclass="stringliteral">"B"</span>);
<aname="l00578"></a>00578 threads[4] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[4], WA_SIZE, prio+5, thread10, <spanclass="stringliteral">"A"</span>);
<aname="l00579"></a>00579 <aclass="code"href="group__condvars.html#ga60c24a8060a884313efe82b8404e77f6"title="Signals all threads that are waiting on the condition variable.">chCondBroadcast</a>(&c1);
<aname="l00580"></a>00580 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00584"></a>00584 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx7 = {
<aname="l00606"></a>00606 <aclass="code"href="group__condvars.html#ga4c698ba6ce06089c08f989e126af9873"title="Initializes s CondVar structure.">chCondInit</a>(&c1);
<aname="l00607"></a>00607 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m1);
<aname="l00608"></a>00608 <aclass="code"href="group__mutexes.html#gac55fe4d05aa6bbeb31594193d2e4d2b6"title="Initializes s Mutex structure.">chMtxInit</a>(&m2);
<aname="l00609"></a>00609 }
<aname="l00610"></a>00610
<aname="l00611"></a>00611 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread11(<spanclass="keywordtype">void</span> *p) {
<aname="l00612"></a>00612
<aname="l00613"></a>00613 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00614"></a>00614 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m1);
<aname="l00616"></a>00616 <spanclass="preprocessor"></span><aclass="code"href="group__condvars.html#ga07a0c55ac1002a64e8c7f9b7e3ca1caf"title="Waits on the condition variable releasing the mutex lock.">chCondWaitTimeout</a>(&c1, <aclass="code"href="group__scheduler.html#gae1568cf3090c973c3bc47f86ae2f5afb"title="Infinite time specification for all the syscalls with a timeout specification.">TIME_INFINITE</a>);
<aname="l00618"></a>00618 <spanclass="preprocessor"></span><aclass="code"href="group__condvars.html#ga466f912bc9b09b133fae862993004ffe"title="Waits on the condition variable releasing the mutex lock.">chCondWait</a>(&c1);
<aname="l00620"></a>00620 <spanclass="preprocessor"></span><aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(*(<spanclass="keywordtype">char</span> *)p);
<aname="l00621"></a>00621 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00622"></a>00622 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00626"></a>00626 <spanclass="keyword">static</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> thread12(<spanclass="keywordtype">void</span> *p) {
<aname="l00627"></a>00627
<aname="l00628"></a>00628 <aclass="code"href="group__mutexes.html#gafa06b82e3496c44eb7bf31d9f1b655ba"title="Locks the specified mutex.">chMtxLock</a>(&m2);
<aname="l00629"></a>00629 <aclass="code"href="group__test.html#gab3d9527d7616b3f9f8cba60cda0211a8"title="Emits a token into the tokens buffer.">test_emit_token</a>(*(<spanclass="keywordtype">char</span> *)p);
<aname="l00630"></a>00630 <aclass="code"href="group__mutexes.html#gae9ae07165126c9f6c0ce0b17bdb53669"title="Unlocks the next owned mutex in reverse lock order.">chMtxUnlock</a>();
<aname="l00636"></a>00636 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio = <aclass="code"href="group__threads.html#gac71903de6268d886ff58022854b8b6dd"title="Returns the current thread priority.">chThdGetPriority</a>();
<aname="l00637"></a>00637 threads[0] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[0], WA_SIZE, prio+1, thread11, <spanclass="stringliteral">"A"</span>);
<aname="l00638"></a>00638 threads[1] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[1], WA_SIZE, prio+2, thread10, <spanclass="stringliteral">"C"</span>);
<aname="l00639"></a>00639 threads[2] = <aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(wa[2], WA_SIZE, prio+3, thread12, <spanclass="stringliteral">"B"</span>);
<aname="l00640"></a>00640 <aclass="code"href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996"title="Signals one thread that is waiting on the condition variable.">chCondSignal</a>(&c1);
<aname="l00641"></a>00641 <aclass="code"href="group__condvars.html#gadddadb68e2a2ce061c7df0d647da9996"title="Signals one thread that is waiting on the condition variable.">chCondSignal</a>(&c1);
<aname="l00642"></a>00642 <aclass="code"href="group__test.html#ga361d9d2685d79754206ae8af370a303c"title="Waits for the completion of all the test-spawned threads.">test_wait_threads</a>();
<aname="l00646"></a>00646 <spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> testmtx8 = {
<aname="l00658"></a><aclass="code"href="testmtx_8h.html#ac43ec07c46a31cbd1f92f1f43ca2051b">00658</a><spanclass="keyword">const</span><spanclass="keyword">struct </span><aclass="code"href="structtestcase.html"title="Structure representing a test case.">testcase</a> * <spanclass="keyword">const</span><aclass="code"href="testmtx_8c.html#a642f97ab257fac66c224357081f84c9a"title="Test sequence for mutexes.">patternmtx</a>[] = {
Generated on Sun Nov 28 2010 14:09:49 for ChibiOS/RT by <ahref="http://www.doxygen.org/index.html"><imgsrc="doxygen.png"alt="doxygen"align="middle"border="0"></a> 1.7.1</small></address>