]> rtime.felk.cvut.cz Git - ert_linux.git/blobdiff - ert_linux/ert_linux_main.tlc
Ensure that mlockall() applies even to already mapped pages.
[ert_linux.git] / ert_linux / ert_linux_main.tlc
index 1b70a0d1c5e9125ebf3431c855ec55c992577f6e..85830b63589244ecde3d3c8b9b83f2e6c29119d2 100644 (file)
@@ -29,6 +29,7 @@
   #include <semaphore.h>                 /* Semaphores library header file */
   #include <time.h>
   #include <stdlib.h>
+  #include <stdbool.h>
   #include <unistd.h>
   #include <sys/mman.h>                  /* For mlockall() */
   #include "%<modelName>.h"              /* Model's header file */
     #include "ext_work.h"                  /* External mode header file */
   %endif
 
+  #ifndef TRUE
+  #define TRUE true
+  #define FALSE false
+  #endif
+
   /*==================*
    * Required defines *
    *==================*/
        %<modelName>_step%<i>();
        sem_wait(&sub_rate[%<i>].sem);    /* sem_val = 0 */
       }
+      return NULL;
     }
   %endforeach
 %endfunction
       (void *)(argv);
     %endif
 
-    CHECKE(mlockall(MCL_FUTURE));
+    CHECKE(mlockall(MCL_CURRENT | MCL_FUTURE));
 
     /* Initialize model */
     %<modelName>_initialize();