More clean-ups and cool template stuff
[invirt/third/libt4.git] / lock_demo.cc
index 4d74acb..3b38cdf 100644 (file)
@@ -1,30 +1,14 @@
-//
-// Lock demo
-//
-
-#include "lock_protocol.h"
 #include "lock_client.h"
-#include "rpc.h"
-#include <arpa/inet.h>
-#include <vector>
-#include <stdlib.h>
-#include <stdio.h>
-
-std::string dst;
-lock_client *lc;
+#include "threaded_log.h"
 
-int
-main(int argc, char *argv[])
-{
-  int r;
+char log_thread_prefix = 'd';
 
-  if(argc != 2){
-    fprintf(stderr, "Usage: %s [host:]port\n", argv[0]);
-    exit(1);
-  }
+int main(int argc, char *argv[]) {
+    if(argc != 2) {
+        fprintf(stderr, "Usage: %s [host:]port\n", argv[0]);
+        return 1;
+    }
 
-  dst = argv[1];
-  lc = new lock_client(dst);
-  r = lc->stat(1);
-  printf ("stat returned %d\n", r);
+    lock_client *lc = new lock_client(argv[1]);
+    LOG_NONMEMBER("stat returned " << lc->stat("1"));
 }