[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1831 - in gnunet-gtk/src: core plugins/fs
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1831 - in gnunet-gtk/src: core plugins/fs |
Date: |
Sun, 21 Aug 2005 17:19:32 -0700 (PDT) |
Author: grothoff
Date: 2005-08-21 17:19:31 -0700 (Sun, 21 Aug 2005)
New Revision: 1831
Modified:
gnunet-gtk/src/core/main.c
gnunet-gtk/src/plugins/fs/fs.c
gnunet-gtk/src/plugins/fs/upload.c
Log:
fixing 894
Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c 2005-08-22 00:14:48 UTC (rev 1830)
+++ gnunet-gtk/src/core/main.c 2005-08-22 00:19:31 UTC (rev 1831)
@@ -88,9 +88,20 @@
return OK;
}
+static void * shutdownCode(void * arg) {
+ Semaphore * sig = arg;
+ stopCron();
+ doneGNUnetGTKCommon();
+ SEMAPHORE_UP(sig);
+ return NULL;
+}
+
int main(int argc,
char *argv[]) {
GtkWidget * root;
+ PTHREAD_T doneThread;
+ Semaphore * sig;
+ void * unused;
g_thread_init(NULL);
gtk_init(&argc, &argv);
@@ -122,10 +133,18 @@
gtk_main();
gdk_threads_leave();
setCustomLogProc(NULL);
- while (YES == gtkRunSomeSaveCalls()) ;
- stopCron();
- doneGNUnetGTKCommon();
+ sig = SEMAPHORE_NEW(0);
+ if (0 != PTHREAD_CREATE(&doneThread,
+ &shutdownCode,
+ sig,
+ 64*1024))
+ DIE_STRERROR("pthread_create");
+ while (OK != SEMAPHORE_DOWN_NONBLOCKING(sig))
+ gtkRunSomeSaveCalls();
+ PTHREAD_JOIN(&doneThread,
+ &unused);
+ SEMAPHORE_FREE(sig);
doneUtil();
return 0;
Modified: gnunet-gtk/src/plugins/fs/fs.c
===================================================================
--- gnunet-gtk/src/plugins/fs/fs.c 2005-08-22 00:14:48 UTC (rev 1830)
+++ gnunet-gtk/src/plugins/fs/fs.c 2005-08-22 00:19:31 UTC (rev 1831)
@@ -115,17 +115,6 @@
(void*) event);
}
-static void * shutdownCode(Semaphore * sig) {
- fs_download_stop();
- fs_search_stop();
- fs_collection_stop();
- fs_namespace_stop();
- fs_upload_stop();
- FSUI_stop(ctx);
- SEMAPHORE_UP(sig);
- return NULL;
-}
-
void init_fs() {
GtkWidget * tab;
GtkWidget * book;
@@ -153,21 +142,12 @@
}
void done_fs() {
- PTHREAD_T doneThread;
- Semaphore * sig;
- void * unused;
-
- sig = SEMAPHORE_NEW(0);
- if (0 != PTHREAD_CREATE(&doneThread,
- (PThreadMain)&shutdownCode,
- sig,
- 64*1024))
- DIE_STRERROR("pthread_create");
- while (OK != SEMAPHORE_DOWN_NONBLOCKING(sig))
- gtkRunSomeSaveCalls();
- PTHREAD_JOIN(&doneThread,
- &unused);
- SEMAPHORE_FREE(sig);
+ fs_download_stop();
+ fs_search_stop();
+ fs_collection_stop();
+ fs_namespace_stop();
+ fs_upload_stop();
+ FSUI_stop(ctx);
}
/* end of fs.c */
Modified: gnunet-gtk/src/plugins/fs/upload.c
===================================================================
--- gnunet-gtk/src/plugins/fs/upload.c 2005-08-22 00:14:48 UTC (rev 1830)
+++ gnunet-gtk/src/plugins/fs/upload.c 2005-08-22 00:19:31 UTC (rev 1831)
@@ -374,6 +374,7 @@
gtk_spin_button_get_value_as_int
(GTK_SPIN_BUTTON(spin)),
doIndex,
+ NO, /* FIXME: make option! */
meta,
gkeywordURI,
keywordURI);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1831 - in gnunet-gtk/src: core plugins/fs,
grothoff <=