PERFORCE change 120808 for review
Andrew Turner
andrew at FreeBSD.org
Sat Jun 2 23:54:37 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=120808
Change 120808 by andrew at 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);
More information about the p4-projects
mailing list