Add readme
This commit is contained in:
59
src/main.c
59
src/main.c
@@ -78,20 +78,6 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
int* ii = malloc(sizeof(int));
|
||||
if(ii == NULL)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
*ii = 0;
|
||||
|
||||
int excode = ptQueuePush(qOut, ii, errbuf);
|
||||
if(excode)
|
||||
{
|
||||
printf("Unable to push 0: %s\n", errbuf);
|
||||
abort();
|
||||
}
|
||||
|
||||
ptQueueElem* tailIn = qIn->tail;
|
||||
|
||||
while (1)
|
||||
@@ -108,22 +94,22 @@ int main(int argc, char** argv)
|
||||
|
||||
|
||||
int* pass = malloc(sizeof(int));
|
||||
if(pass != NULL)
|
||||
if(pass == NULL)
|
||||
{
|
||||
*pass = *code;
|
||||
int excode = ptQueuePush(qOut, pass, errbuf);
|
||||
if(excode)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
if(*code == 0)
|
||||
*pass = *code;
|
||||
int excode = ptQueuePush(qOut, pass, errbuf);
|
||||
if(excode)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
if(*code == 4095)
|
||||
{
|
||||
free(payload);
|
||||
break;
|
||||
}
|
||||
free(payload);
|
||||
ptQueueElem* newTail = atomic_load(&(tailIn->nextEl));
|
||||
if (newTail == NULL)
|
||||
{
|
||||
@@ -131,8 +117,31 @@ int main(int argc, char** argv)
|
||||
}
|
||||
free(tailIn);
|
||||
tailIn = newTail;
|
||||
|
||||
|
||||
excode = ptQueuePush(qOut, payload, errbuf);
|
||||
if(excode)
|
||||
{
|
||||
printf("Unable to push: %s\n", errbuf);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
int* ii = malloc(sizeof(int));
|
||||
if(ii == NULL)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
*ii = 0;
|
||||
|
||||
int excode = ptQueuePush(qOut, ii, errbuf);
|
||||
if(excode)
|
||||
{
|
||||
printf("Unable to push 0: %s\n", errbuf);
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
pthread_join(tid, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user