Msg *msg;
void *ref;
- usleep((rand() % 10) * 1000);
msg = eina_thread_queue_send(thq1, sizeof(Msg), &ref);
if (!msg)
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
if (!msg)
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
val = msg->value;
- usleep((rand() % 20) * 1000);
eina_thread_queue_wait_done(thq1, ref);
msg = eina_thread_queue_send(thq2, sizeof(Msg), &ref);
Msg5 *msg;
void *ref;
- usleep((rand() % 10) * 1000);
msg = eina_thread_queue_send(thq1, sizeof(Msg5), &ref);
if (!msg)
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
if (!msg)
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
val = msg->value;
- usleep((rand() % 20) * 1000);
eina_thread_queue_wait_done(thq1, ref);
msg = eina_thread_queue_send(thq2, sizeof(Msg5), &ref);
* @{
* @objective Test eina_thread_queue_wait functions.
* @n Input Data:
- * @li Thread 1 task: function th1_do. This function allocate a message to send down a thread queue and send this messge into queue. Repeat this until value not equal 1000 with random delay (((rand() % 10) * 1000)).
+ * @li Thread 1 task: function th1_do. This function allocate a message to send down a thread queue and send this messge into queue. Repeat this until value not equal 1000.
* @li Thread 2 task: function th2_do. This function fetch a message from thread queue by thread1 sends. After that
- send values back into thread queue. Repeat this until value not equal 1000 times random delay (((rand() % 20) * 1000)).
+ send values back into thread queue. Repeat this until value not equal 1000 times.
* @li Inital value for count 99.
*
* @procedure
if (msg->value != (val + 1))
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
val = msg->value;
- usleep((rand() % 30) * 1000);
eina_thread_queue_wait_done(thq2, ref);
if (val == 1000) break;
}
* @step 1 Launch a thread to run a thspeed1_do task that can talk back to the main thread.
* @step 2 Allocate a message to send down a thread queue
* @step 3 Check that amount of sent messages not less than 1000000.
- * @step 4 If messages less than 1000000 are received, wait 100ms. (Check the number of received messages every 1ms)
+ * @step 4 If messages less than 1000000 are received, wait 100us. (Check the number of received messages every 1us)
*
* @passcondition
- * All checks passed within 100ms and no segmentation fault.
+ * All checks passed within 100us and no segmentation fault.
* @}
* @}
*/
{
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Failed to receive messages. (%d/1000000) messages have been received.", __FILE__, __LINE__, mcount);
}
- usleep(1000); // Wait 1ms
+ usleep(1); // Wait 1us
mcount = msgs;
}
printf("[TEST_PASS]:: %s[%d] : Test has passed.\n", __FILE__, __LINE__);
ck_abort_msg("[TEST_FAIL]:: %s[%d] : Test has failed..", __FILE__, __LINE__);
}
val = msg->value;
- usleep((rand() % 10) * 1000);
eina_thread_queue_wait_done(thq2, ref);
if (val == 1100) break;
}
- else
- {
- usleep((rand() % 10) * 1000);
- }
}
printf("[TEST_PASS]:: %s[%d] : Test has passed..\n", __FILE__, __LINE__);
}