Twitch SDK (Internal)
threadsync.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
13 
14 namespace ttv
15 {
16  class IThreadSync;
17  class IThreadSyncFactory;
18 
19  void SetThreadSyncFactory(std::shared_ptr<IThreadSyncFactory> factory);
20 
21  TTV_ErrorCode CreateThreadSync(std::shared_ptr<IThreadSync>& result);
22 }
23 
24 
26 {
27 public:
28  virtual ~IThreadSync();
29 
30  virtual TTV_ErrorCode Suspend() = 0;
31  virtual TTV_ErrorCode SuspendFor(uint duration) = 0;
32  virtual TTV_ErrorCode Signal() = 0;
33 };
34 
35 
37 {
38 public:
39  virtual ~IThreadSyncFactory();
40 
41  virtual TTV_ErrorCode CreateThreadSync(std::shared_ptr<IThreadSync>& result) = 0;
42 };
TTV_ErrorCode CreateThreadSync(std::shared_ptr< IThreadSync > &result)
void SetThreadSyncFactory(std::shared_ptr< IThreadSyncFactory > factory)
virtual TTV_ErrorCode Suspend()=0
Definition: threadsync.h:25
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
unsigned int uint
Definition: coretypes.h:18
virtual TTV_ErrorCode SuspendFor(uint duration)=0
Definition: threadsync.h:36
virtual TTV_ErrorCode Signal()=0
virtual ~IThreadSync()