]> Nishi Git Mirror - gwion.git/commitdiff
:art: Move is_running to BBQ
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 12 Mar 2019 16:43:32 +0000 (17:43 +0100)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 12 Mar 2019 16:43:50 +0000 (17:43 +0100)
include/vm.h
src/gwion.c
src/main.c
src/vm/driver.c
src/vm/shreduler.c
src/vm/vm.c
tests/import/driver.c

index 44e057f39d31758f80c15afa43da9824fbd5c957..1dde1ad530b39ee357378e51201d6a8305510c6e 100644 (file)
@@ -21,6 +21,7 @@ struct BBQ_ {
   uint32_t sr; // int 32
   uint8_t n_in;
   uint8_t n_out;
+  volatile uint is_running;// : 1; // => shreduler
 };
 
 typedef struct Shreduler_* Shreduler;
@@ -31,7 +32,6 @@ typedef struct VM_ {
   struct BBQ_* bbq;
   struct Gwion_* gwion;
   uint32_t rand[2];
-  volatile unsigned is_running : 1; // => shreduler
 } VM;
 
 typedef struct VM_Shred_* VM_Shred;
index fe2ff00e0e399add1c9e56b181ce95c290c70765..df5783f157781a46510f2818b3f91fe1cdb51586 100644 (file)
@@ -93,7 +93,7 @@ ANN m_bool gwion_ini(const Gwion gwion, int argc, char** argv) {
 
 ANN void gwion_run(const Gwion gwion) {
   VM* vm = gwion->vm;
-  vm->is_running = 1;
+  vm->bbq->is_running = 1;
   plug_ini(gwion, &gwion->arg->mod);
   VMBENCH_INI
   gwion->di->driver->run(vm, gwion->di);
index 95f9b74d0e44bc7d617ac41d5a4bec2362766c93..3f2bed072a3c20ee42c5073c6d6de526f000f204 100644 (file)
@@ -9,7 +9,7 @@
 static struct Gwion_ gwion;
 
 static void sig(int unused __attribute__((unused))) {
-  gwion.vm->is_running = 0;
+  gwion.vm->bbq->is_running = 0;
 }
 
 int main(int argc, char** argv) {
index 22360bbd57f620c04ae57c4ccfd57370fe5f9551..c519cd2eba7750b7044af9e311718bcc572fee2a 100644 (file)
@@ -20,7 +20,7 @@ ANN struct BBQ_* new_bbq(DriverInfo* di) {
 }
 
 static void dummy_run(VM* vm, DriverInfo* di) {
-  while(vm->is_running) {
+  while(vm->bbq->is_running) {
     di->run(vm);
     ++vm->bbq->pos;
   }
index c9f8df737a6cdebe8a0b75292bea1e8dab140d25..865f84577e4bd872ab8a0dd24702eeaf748ee534 100644 (file)
@@ -15,7 +15,7 @@ ANN VM_Shred shreduler_get(const Shreduler s) {
   struct ShredTick_ *tk = s->list;
   if(!tk) {
     if(!vector_size(&s->shreds) && !s->loop)
-      vm->is_running = 0;
+      vm->bbq->is_running = 0;
     return NULL;
   }
   const m_float time = (m_float)vm->bbq->pos + (m_float).5;
index 17d0dc479f018c59454b9a08aa2bba37a33b6d51..7c0f77e2140d0790bfda6bb5c9411110ef359d2d 100644 (file)
@@ -760,7 +760,7 @@ timespecsub(&exec_end, &exec_ini, &exec_ret);
 timespecadd(&exec_time, &exec_ret, &exec_time);
 #endif
   }
-  if(!vm->is_running) {
+  if(!vm->bbq->is_running) {
 #ifdef VMBENCH
     printf("[VM] exec time %lu.%09lu\n", exec_time.tv_sec, exec_time.tv_nsec);
     printf("[VM] exec time %09lu\n", exec_time.tv_nsec/1000);
index ec3c447f73880185563c00541750978f2b7a707a..9e685f8a50190f1a2d7a3fcf8eac0e157fce7b21 100644 (file)
@@ -10,7 +10,7 @@
 #include "plug.h"
 
 static void dummy_run(VM* vm, DriverInfo* di) {
-  while(vm->is_running) {
+  while(vm->bbq->is_running) {
     di->run(vm);
     ++vm->bbq->pos;
   }