diff options
Diffstat (limited to 'backend/net/NetWorker.cpp')
-rw-r--r-- | backend/net/NetWorker.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backend/net/NetWorker.cpp b/backend/net/NetWorker.cpp new file mode 100644 index 00000000..1eef13d9 --- /dev/null +++ b/backend/net/NetWorker.cpp @@ -0,0 +1,12 @@ +#include "NetWorker.h" +#include <QThreadStorage> + +NetWorker& NetWorker::spawn() +{ + static QThreadStorage<NetWorker *> storage; + if (!storage.hasLocalData()) + { + storage.setLocalData(new NetWorker()); + } + return *storage.localData(); +} |