]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commitdiff
Changed executor's thread creation
authorTuka Martin <tukamart@fel.cvut.cz>
Tue, 4 Oct 2011 20:11:01 +0000 (22:11 +0200)
committerTuka Martin <tukamart@fel.cvut.cz>
Tue, 4 Oct 2011 20:11:01 +0000 (22:11 +0200)
Threads are created via fosa_thread_create function.

src/fwp/fwp/mngr/fwp_mngr.c

index 9ade1f400ce4060fe1cce6ca248a8767eab2306c..c2612672b103b7271dfdc59da2601ad128a8f0b4 100644 (file)
@@ -122,6 +122,13 @@ usage(void)
        printf("  -h, --help\n");
 }
 
+void *executor_thread(void *arg)
+{
+        forb_executor_t *executor = arg;
+        forb_executor_run(executor);
+        return NULL;
+}
+
 int main(int argc, char *argv[])
 {
        forb_orb orb;
@@ -178,6 +185,7 @@ int main(int argc, char *argv[])
 
        int pid;
        int pid2;
+       fosa_thread_id_t tid;
 
        fcb_orb = forb_init(NULL, NULL, NULL);
        if (!fcb_orb) error(1, errno, "forb_init");
@@ -198,7 +206,7 @@ int main(int argc, char *argv[])
        // Initialize head of linked list
        sta_list_init_head(&priv.sta_list);
        
-       //create executor and register 2 interfaces
+       //create executors and register 2 interfaces
        ret = forb_executor_init(&executor_wai);
        if (ret) goto error;
 
@@ -220,6 +228,15 @@ int main(int argc, char *argv[])
 
                forb_daemon_ready();
 
+       printf("Ready to create threads\n");
+       fosa_thread_create(&tid, NULL, executor_thread, &executor_wai);
+       fosa_thread_create(&tid, NULL, executor_thread, &executor_frm);
+
+       while(1) {
+               ;
+       }
+
+       /*
        pid = fork();
        if(pid != 0)            
        {
@@ -246,7 +263,7 @@ int main(int argc, char *argv[])
                        //exit(0);
                }
        }
-
+       */
 
 destroy_and_error:
        forb_executor_destroy(&executor_wai);