Date: Sat, 2 Jun 2007 23:54:36 GMT From: Andrew Turner <andrew@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 120808 for review Message-ID: <200706022354.l52Nsa5U087959@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=120808 Change 120808 by andrew@andrew_hermies on 2007/06/02 23:53:55 Create a thread to look for updates. There will be another thread created to do any IPC required later. Affected files ... .. //depot/projects/soc2007/andrew-update/backend/Makefile#4 edit .. //depot/projects/soc2007/andrew-update/backend/facund-be.c#5 edit Differences ... ==== //depot/projects/soc2007/andrew-update/backend/Makefile#4 (text+ko) ==== @@ -1,5 +1,6 @@ PROG= facund-be +CFLAGS+=-pthread LDADD+= -lutil -lmd MAN= ==== //depot/projects/soc2007/andrew-update/backend/facund-be.c#5 (text+ko) ==== @@ -27,6 +27,8 @@ * */ +#include <pthread.h> + #include <sys/types.h> #include <sys/event.h> #include <sys/stat.h> @@ -226,6 +228,7 @@ int main(int argc __unused, char *argv[] __unused) { + pthread_t update_thread; const char *config_file; char *basedirs_string, **base_dirs; int config_fd; @@ -279,7 +282,8 @@ config_file); } - look_for_updates(base_dirs); + pthread_create(&update_thread, NULL, look_for_updates, base_dirs); + pthread_join(update_thread, NULL); if (base_dirs != NULL) free(base_dirs);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706022354.l52Nsa5U087959>