Coding style change
This commit is contained in:
+7
-7
@@ -15,10 +15,10 @@ void *reader(void *arg)
|
||||
{
|
||||
int i;
|
||||
int last;
|
||||
for(i = 0; i < CNT/2; i++) {
|
||||
for (i = 0; i < CNT/2; i++) {
|
||||
struct uc_threadmsg *msg;
|
||||
struct my_msg *my;
|
||||
if(uc_thread_queue_get(&queue, NULL, &msg) != 0) {
|
||||
if (uc_thread_queue_get(&queue, NULL, &msg) != 0) {
|
||||
printf("uc_threadqueue_get failed\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -39,25 +39,25 @@ int main(int argc, char *argv[])
|
||||
|
||||
uc_thread_queue_init(&queue, 100);
|
||||
|
||||
if(pthread_create(&tid1, NULL, reader, NULL) != 0) {
|
||||
if (pthread_create(&tid1, NULL, reader, NULL) != 0) {
|
||||
perror("pthread_create");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(pthread_create(&tid2, NULL, reader, NULL) != 0) {
|
||||
if (pthread_create(&tid2, NULL, reader, NULL) != 0) {
|
||||
perror("pthread_create");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for(i = 0; i < CNT; i++) {
|
||||
for (i = 0; i < CNT; i++) {
|
||||
struct my_msg *msg = malloc(sizeof *msg);
|
||||
if(msg == NULL) {
|
||||
if (msg == NULL) {
|
||||
perror("malloc");
|
||||
return 1;
|
||||
}
|
||||
msg->uc_msg.msgtype = 11;
|
||||
msg->counter = i;
|
||||
if(uc_thread_queue_add(&queue, &msg->uc_msg) != 0) {
|
||||
if (uc_thread_queue_add(&queue, &msg->uc_msg) != 0) {
|
||||
printf("uc_threadqueue_add failed\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user