Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing thread start_routine signatures in tests #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_destroy/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "posixtest.h"


void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_init/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

int sem1; /* Manual semaphore */

void *a_thread_func()
void *a_thread_func(void* arg)
{

/* Indicate to main() that the thread was created. */
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setdetachstate/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <errno.h>
#include "posixtest.h"

void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setinheritsched/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "

const long int policy = SCHED_FIFO;
void *thread_func()
void *thread_func(void* arg)
{
int rc;
int new_policy;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setschedparam/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

volatile int thread_created = 0;

void *thread_func()
void *thread_func(void* arg)
{
thread_created = 1;
pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setschedparam/1-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

volatile int thread_created = 0;

void *thread_func()
void *thread_func(void* arg)
{
thread_created = 1;
pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setschedpolicy/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <errno.h>
#include "posixtest.h"

void *thread_func()
void *thread_func(void* arg)
{
pthread_exit(0);
return (void*)(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setscope/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define CONSCOPE PTHREAD_SCOPE_SYSTEM

void *thread_func()
void *thread_func(void* arg)
{
pthread_exit(0);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setstack/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
static void *stack_addr;
size_t stack_size;

void *thread_func()
void *thread_func(void* arg)
{
pthread_exit(0);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setstack/4-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ size_t stack_size;
int teststack() {
return 0;
}
void *thread_func()
void *thread_func(void* arg)
{
/* execute a function to test the read/right of the stack*/
if (teststack() != 0) {
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_attr_setstacksize/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define STACKADDROFFSET 0x8000000

void *thread_func()
void *thread_func(void* arg)
{
pthread_exit(0);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void a_cleanup_func(void *unused)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/1-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void a_cleanup_func(void *unused)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);

Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/1-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void a_cleanup_func(void *unused)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void a_cleanup_func(void *unused)
* loop, never reaching the cleanup_pop function. So the only way the cleanup
* function can be called is when the thread is canceled and all the cleanup
* functions are supposed to be popped. */
void *a_thread_func()
void *a_thread_func(void* arg)
{
/* To enable thread immediate cancelation, since the default
* is PTHREAD_CANCEL_DEFERRED. */
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/3-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void a_cleanup_func(void *unused)
* function can be called is when the thread is canceled and all the cleanup
* functions are supposed to be popped.
*/
void *a_thread_func()
void *a_thread_func(void* arg)
{
int rc = 0;

Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/4-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "posixtest.h"

int sem; /* Manual semaphore */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);

Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cancel/5-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <errno.h>
#include "posixtest.h"

void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_exit(0);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cleanup_pop/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void a_cleanup_func(void *flag_val)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_cleanup_push(a_cleanup_func, (void*) CLEANUP_CALLED);
pthread_cleanup_pop(1);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cleanup_pop/1-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void a_cleanup_func(void *flag_val)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_cleanup_push(a_cleanup_func, (void*) CLEANUP_CALLED);
pthread_cleanup_pop(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cleanup_pop/1-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void a_cleanup_func3(void *flag_val)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_cleanup_push(a_cleanup_func1, NULL);
pthread_cleanup_push(a_cleanup_func2, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cleanup_push/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void a_cleanup_func(void *flag_val)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_cleanup_push(a_cleanup_func, (void*) CLEANUP_CALLED);

Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cleanup_push/1-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void a_cleanup_func(void *flag_val)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_cleanup_push/1-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void a_cleanup_func(void *flag_val)
}

/* Function that the thread executes upon its creation */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_cleanup_push(a_cleanup_func, (void*) CLEANUP_CALLED);
pthread_cleanup_pop(1);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_create/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <stdio.h>
#include "posixtest.h"

void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_create/1-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <unistd.h>
#include "posixtest.h"

void *a_thread_func()
void *a_thread_func(void* arg)
{
sleep(10);

Expand Down
8 changes: 4 additions & 4 deletions conformance/interfaces/pthread_create/1-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <signal.h>
#include "posixtest.h"

void *a_thread_function();
void alarm_handler();
void *a_thread_function(void* arg);
void alarm_handler(int);

pthread_t a;

Expand Down Expand Up @@ -62,7 +62,7 @@ int main()
}

/* A never-ending thread function */
void *a_thread_function()
void *a_thread_function(void* arg)
{
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);

Expand All @@ -74,7 +74,7 @@ void *a_thread_function()
}

/* If this handler is called, that means that the test has failed. */
void alarm_handler()
void alarm_handler(int unused)
{
printf("Test FAILED\n");
exit(PTS_FAIL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_create/12-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "posixtest.h"

/* Thread starting routine that really does nothing. */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_exit(0);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_create/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <errno.h>
#include "posixtest.h"

void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_create/3-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

int sem1; /* Manual semaphore */

void *a_thread_func()
void *a_thread_func(void* arg)
{
/* Indicate to main() that the thread was created. */
sem1=INTHREAD;
Expand Down
4 changes: 2 additions & 2 deletions conformance/interfaces/pthread_create/4-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <stdio.h>
#include "posixtest.h"

void *a_thread_func();
void *a_thread_func(void* arg);

pthread_t self_th; /* Save the value of the function call pthread_self()
within the thread. Keeping it global so 'main' can
Expand Down Expand Up @@ -59,7 +59,7 @@ int main()
}

/* The thread function that calls pthread_self() to obtain its thread ID */
void *a_thread_func()
void *a_thread_func(void* arg)
{
self_th=pthread_self();
pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_detach/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "posixtest.h"


void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);

Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_detach/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "posixtest.h"


void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_detach/3-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "posixtest.h"

/* Thread function */
void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_detach/4-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "posixtest.h"

/* Thread function */
void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_detach/4-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "posixtest.h"

/* Thread function */
void *a_thread_func()
void *a_thread_func(void* arg)
{
pthread_exit(0);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_equal/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "posixtest.h"


void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_equal/1-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "posixtest.h"


void *a_thread_func()
void *a_thread_func(void* arg)
{

pthread_exit(0);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_exit/1-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
int sem; /* Manual semaphore used to indicate when the thread has been created. */

/* Thread's function. */
void *a_thread_func()
void *a_thread_func(void* arg)
{
sem=INMAIN;
pthread_exit((void*)RETURN_CODE);
Expand Down
2 changes: 1 addition & 1 deletion conformance/interfaces/pthread_exit/2-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void a_cleanup_func3(void *dummy)
return;
}
/* Thread's function. */
void *a_thread_func()
void *a_thread_func(void* arg)
{
/* Set up 3 cleanup handlers */
pthread_cleanup_push(a_cleanup_func1,NULL);
Expand Down
Loading