Skip to content

Commit 6afa855

Browse files
committed
Add a signal to kill 26.6.28.1's new dedicated thread at game exit, because the thread would otherwise keep running and prevent games from exiting...
1 parent 9bd2ee2 commit 6afa855

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

CHANGELOG.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
26.6.28.1
1+
26.6.28.2
2+
=========
3+
+ Add a signal to kill 26.6.28.1's new dedicated thread at game exit,
4+
because the thread would otherwise keep running and prevent games
5+
from exiting...
6+
7+
26.6.28.1
28
=========
39
+ Apply Unity Framerate Limit override once per-frame if necessary,
410
using a dedicated Mono-managed thread rather than a game's

include/SpecialK/DLL_VERSION.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#define SK_YEAR 26
44
#define SK_MONTH 6
55
#define SK_DATE 28
6-
#define SK_REV_N 1
7-
#define SK_REV 1
6+
#define SK_REV_N 2
7+
#define SK_REV 2
88

99
#ifndef _A2
1010
#define _A2(a) #a

src/plugins/unity.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,12 @@ SK_Unity_SetTargetFrameRate (void)
18321832
static HANDLE hSetTargetFramerateSignal =
18331833
SK_CreateEvent (nullptr, FALSE, TRUE, nullptr);
18341834

1835+
static HANDLE
1836+
signals [] = {
1837+
__SK_DLL_TeardownEvent,
1838+
hSetTargetFramerateSignal
1839+
};
1840+
18351841
static int target_fps;
18361842
target_fps = (int)ceilf (__target_fps_now);
18371843

@@ -1846,7 +1852,8 @@ SK_Unity_SetTargetFrameRate (void)
18461852

18471853
while (! ReadAcquire (&__SK_DLL_Ending))
18481854
{
1849-
WaitForSingleObject (hSetTargetFramerateSignal, INFINITE);
1855+
if (WAIT_OBJECT_0 == WaitForMultipleObjects (2, signals, FALSE, INFINITE))
1856+
break;
18501857

18511858
void* params [1] = { &target_fps };
18521859

@@ -1872,7 +1879,8 @@ SK_Unity_SetTargetFrameRate (void)
18721879

18731880
while (! ReadAcquire (&__SK_DLL_Ending))
18741881
{
1875-
WaitForSingleObject (hSetTargetFramerateSignal, INFINITE);
1882+
if (WAIT_OBJECT_0 == WaitForMultipleObjects (2, signals, FALSE, INFINITE))
1883+
break;
18761884

18771885
void* params [1] = { &target_fps };
18781886

0 commit comments

Comments
 (0)