So many changes. Broken.
[invirt/third/libt4.git] / lock_smain.cc
index fecd7f8..52e6c4f 100644 (file)
@@ -1,17 +1,12 @@
-#include "lock_server.h"
-#include <arpa/inet.h>
-#include <unistd.h>
+#include "include/lock_server.h"
 
-// Main loop of lock_server
-
-char log_thread_prefix = 's';
+using namespace std::chrono;
 
 int main(int argc, char *argv[]) {
+    global = new t4_state('s');
     setvbuf(stdout, NULL, _IONBF, 0);
     setvbuf(stderr, NULL, _IONBF, 0);
 
-    srandom((uint32_t)getpid());
-
     if(argc != 3){
         LOG_NONMEMBER << "Usage: " << argv[0] << " [master:]port [me:]port";
         exit(1);
@@ -23,5 +18,5 @@ int main(int argc, char *argv[]) {
     rsm.start();
 
     while(1)
-        sleep(1000);
+        std::this_thread::sleep_for(1000ms);
 }