mirror of
https://github.com/debauchee/barrier.git
synced 2024-11-23 09:43:24 +03:00
b3291bc2b5
wait forever). also fixed early return from sleep due to signal. now forcing client to initialize CThread to ensure global mutex gets initialized before threads are used.
33 lines
617 B
C++
33 lines
617 B
C++
#include "CServer.h"
|
|
#include "CScreenMap.h"
|
|
#include "CThread.h"
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
CThread::init();
|
|
|
|
if (argc != 1) {
|
|
fprintf(stderr, "usage: %s\n", argv[0]);
|
|
return 1;
|
|
}
|
|
|
|
CScreenMap screenMap;
|
|
screenMap.addScreen("primary");
|
|
screenMap.addScreen("ingrid");
|
|
screenMap.connect("primary", CScreenMap::kRight, "ingrid");
|
|
screenMap.connect("ingrid", CScreenMap::kLeft, "primary");
|
|
|
|
try {
|
|
CServer* server = new CServer();
|
|
server->setScreenMap(screenMap);
|
|
server->run();
|
|
}
|
|
catch (XBase& e) {
|
|
fprintf(stderr, "failed: %s\n", e.what());
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|