Twitch SDK (Internal)
winthreadsync.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 
12 
13 #include <windows.h>
14 
15 
16 namespace ttv
17 {
18  class WinThreadSync;
19  class WinThreadSyncFactory;
20 }
21 
22 
24 {
25 public:
26  WinThreadSync();
27  virtual ~WinThreadSync();
28 
29  virtual TTV_ErrorCode Suspend() override;
30  virtual TTV_ErrorCode SuspendFor(uint duration) override;
31  virtual TTV_ErrorCode Signal() override;
32 
33 private:
34  HANDLE mSyncAtom;
35 
36  bool mFallthru; // fall-thru will be on if a thread signal is signaled but without any threads suspended
37  // used for non windows implementations to emulate a self resetting event
38 };
39 
40 
42 {
43 public:
44  virtual TTV_ErrorCode CreateThreadSync(std::shared_ptr<IThreadSync>& result) override;
45 };
TTV_ErrorCode CreateThreadSync(std::shared_ptr< IThreadSync > &result)
Definition: threadsync.h:25
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
bool mFallthru
Definition: winthreadsync.h:36
virtual TTV_ErrorCode SuspendFor(uint duration) override
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
unsigned int uint
Definition: coretypes.h:18
Definition: threadsync.h:36
virtual TTV_ErrorCode Signal() override
virtual TTV_ErrorCode Suspend() override
HANDLE mSyncAtom
Definition: winthreadsync.h:34
Definition: winthreadsync.h:41
virtual ~WinThreadSync()
Definition: winthreadsync.h:23