diff --git a/Makefile b/Makefile index c8818bf..a212088 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,9 @@ REMOVE = rm -f #Objects -OBJS = main.o socket.o tuve.o channel.o +OBJS = botthread.o main.o socket.o tuve.o channel.o -LIBRARIES = +LIBRARIES = -lthr CFLAGS = -Wall -O2 # Link The Binary diff --git a/botthread.c b/botthread.c new file mode 100644 index 0000000..67dd592 --- /dev/null +++ b/botthread.c @@ -0,0 +1,28 @@ +#include +#include + +#include "tuved.h" + +void *PrintHello(void *threadid) { + int tid; + tid = (int)threadid; + printf("Hello World! It's me, thread #%d!\n", tid); + pthread_exit(NULL); + } + +/* +int main (int argc, char *argv[]) +{ + pthread_t threads[NUM_THREADS]; + int rc, t; + for(t=0; t -#define MYPORT 9999 // the port users will be connecting to -#define BACKLOG 10 // how many pending connections queue will hold -#define LOG_FILE "./tuved.log" +#define NUM_THREADS 5 +#define MYPORT 9999 // the port users will be connecting to +#define BACKLOG 10 // how many pending connections queue will hold +#define LOG_FILE "./tuved.log" typedef struct tuveUserList { struct tuveUserList *prev;