Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7346fa2

Browse files
committed
remove CoreSuspendClaimer alias
1 parent d16b857 commit 7346fa2

10 files changed

Lines changed: 19 additions & 22 deletions

File tree

library/Core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ int Core::Shutdown ( void )
24162416
d->hotkeythread.join();
24172417
d->iothread.join();
24182418

2419-
CoreSuspendClaimer suspend;
2419+
CoreSuspender suspend;
24202420
if(plug_mgr)
24212421
{
24222422
delete plug_mgr;

library/include/Core.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,4 @@ namespace DFHack
481481
CoreSuspendClaimMain();
482482
~CoreSuspendClaimMain();
483483
};
484-
485-
using CoreSuspendClaimer = CoreSuspender;
486484
}

library/include/VTableInterpose.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ namespace DFHack
4646
4747
DEFINE_VMETHOD_INTERPOSE(int, foo, (int arg)) {
4848
// If needed by the code, claim the suspend lock.
49-
// DO NOT USE THE USUAL CoreSuspender, OR IT WILL DEADLOCK!
50-
// CoreSuspendClaimer suspend;
49+
// CoreSuspender suspend;
5150
...
5251
... this->field ... // access fields of the df::someclass object
5352
...

library/modules/Screen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ df::viewscreen *dfhack_lua_viewscreen::get_pointer(lua_State *L, int idx, bool m
860860

861861
bool dfhack_lua_viewscreen::safe_call_lua(int (*pf)(lua_State *), int args, int rvs)
862862
{
863-
CoreSuspendClaimer suspend;
863+
CoreSuspender suspend;
864864
color_ostream_proxy out(Core::getInstance().getConsole());
865865

866866
auto L = Lua::Core::State;

plugins/building-hacks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ struct work_hook : df::building_workshopst{
252252
{
253253
if(world->frame_counter % def->skip_updates == 0)
254254
{
255-
CoreSuspendClaimer suspend;
255+
CoreSuspender suspend;
256256
color_ostream_proxy out(Core::getInstance().getConsole());
257257
onUpdateAction(out,this);
258258
}

plugins/devel/eventExample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct my_contaminate : df::item_actual {
5353
typedef df::item_actual interpose_base;
5454
DEFINE_VMETHOD_INTERPOSE(void, contaminateWound, (df::unit* unit, df::unit_wound* wound, uint8_t unk1, int16_t unk2)) {
5555
INTERPOSE_NEXT(contaminateWound)(unit,wound,unk1,unk2);
56-
CoreSuspendClaimer suspend;
56+
CoreSuspender suspend;
5757
Core::getInstance().print("contaminateWound: item=%d, unit=%d, wound attacker = %d, unk1 = %d, unk2 = %d\n", this->id, unit->id, wound->unit_id, (int32_t)unk1, (int32_t)unk2);
5858
}
5959
};

plugins/eventful.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ struct workshop_hook : df::building_workshopst{
305305
typedef df::building_workshopst interpose_base;
306306
DEFINE_VMETHOD_INTERPOSE(void,fillSidebarMenu,())
307307
{
308-
CoreSuspendClaimer suspend;
308+
CoreSuspender suspend;
309309
color_ostream_proxy out(Core::getInstance().getConsole());
310310
bool call_native=true;
311311
onWorkshopFillSidebarMenu(out,this,&call_native);
@@ -320,7 +320,7 @@ struct furnace_hook : df::building_furnacest{
320320
typedef df::building_furnacest interpose_base;
321321
DEFINE_VMETHOD_INTERPOSE(void,fillSidebarMenu,())
322322
{
323-
CoreSuspendClaimer suspend;
323+
CoreSuspender suspend;
324324
color_ostream_proxy out(Core::getInstance().getConsole());
325325
bool call_native=true;
326326
onWorkshopFillSidebarMenu(out,this,&call_native);
@@ -351,7 +351,7 @@ struct product_hook : item_product {
351351
return;
352352
}
353353
df::reaction* this_reaction=product->react;
354-
CoreSuspendClaimer suspend;
354+
CoreSuspender suspend;
355355
bool call_native=true;
356356
onReactionCompleting(out,this_reaction,(df::reaction_product_itemst*)this,unit,in_items,in_reag,out_items,&call_native);
357357
if(!call_native)
@@ -375,7 +375,7 @@ struct item_hooks :df::item_actual {
375375

376376
DEFINE_VMETHOD_INTERPOSE(void, contaminateWound,(df::unit* unit, df::unit_wound* wound, int32_t a1, int16_t a2))
377377
{
378-
CoreSuspendClaimer suspend;
378+
CoreSuspender suspend;
379379
color_ostream_proxy out(Core::getInstance().getConsole());
380380
onItemContaminateWound(out,this,unit,wound,a1,a2);
381381
INTERPOSE_NEXT(contaminateWound)(unit,wound,a1,a2);
@@ -388,14 +388,14 @@ struct proj_item_hook: df::proj_itemst{
388388
typedef df::proj_itemst interpose_base;
389389
DEFINE_VMETHOD_INTERPOSE(bool,checkImpact,(bool mode))
390390
{
391-
CoreSuspendClaimer suspend;
391+
CoreSuspender suspend;
392392
color_ostream_proxy out(Core::getInstance().getConsole());
393393
onProjItemCheckImpact(out,this,mode);
394394
return INTERPOSE_NEXT(checkImpact)(mode); //returns destroy item or not?
395395
}
396396
DEFINE_VMETHOD_INTERPOSE(bool,checkMovement,())
397397
{
398-
CoreSuspendClaimer suspend;
398+
CoreSuspender suspend;
399399
color_ostream_proxy out(Core::getInstance().getConsole());
400400
onProjItemCheckMovement(out,this);
401401
return INTERPOSE_NEXT(checkMovement)();
@@ -408,14 +408,14 @@ struct proj_unit_hook: df::proj_unitst{
408408
typedef df::proj_unitst interpose_base;
409409
DEFINE_VMETHOD_INTERPOSE(bool,checkImpact,(bool mode))
410410
{
411-
CoreSuspendClaimer suspend;
411+
CoreSuspender suspend;
412412
color_ostream_proxy out(Core::getInstance().getConsole());
413413
onProjUnitCheckImpact(out,this,mode);
414414
return INTERPOSE_NEXT(checkImpact)(mode); //returns destroy item or not?
415415
}
416416
DEFINE_VMETHOD_INTERPOSE(bool,checkMovement,())
417417
{
418-
CoreSuspendClaimer suspend;
418+
CoreSuspender suspend;
419419
color_ostream_proxy out(Core::getInstance().getConsole());
420420
onProjUnitCheckMovement(out,this);
421421
return INTERPOSE_NEXT(checkMovement)();

plugins/rendermax/rendermax.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct dwarmode_render_hook : viewscreen_dwarfmodest{
5959
typedef df::viewscreen_dwarfmodest interpose_base;
6060
DEFINE_VMETHOD_INTERPOSE(void,render,())
6161
{
62-
CoreSuspendClaimer suspend;
62+
CoreSuspender suspend;
6363
engine->preRender();
6464
INTERPOSE_NEXT(render)();
6565
engine->calculate();
@@ -72,7 +72,7 @@ struct dungeon_render_hook : viewscreen_dungeonmodest{
7272
typedef df::viewscreen_dungeonmodest interpose_base;
7373
DEFINE_VMETHOD_INTERPOSE(void,render,())
7474
{
75-
CoreSuspendClaimer suspend;
75+
CoreSuspender suspend;
7676
engine->preRender();
7777
INTERPOSE_NEXT(render)();
7878
engine->calculate();
@@ -298,7 +298,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan
298298
{
299299
case SC_VIEWSCREEN_CHANGED:
300300
{
301-
CoreSuspendClaimer suspender;
301+
CoreSuspender suspender;
302302
if(current_mode==MODE_LIGHT)
303303
{
304304
engine->clear();

plugins/siege-engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ struct projectile_hook : df::proj_itemst {
16731673
return;
16741674

16751675
auto L = Lua::Core::State;
1676-
CoreSuspendClaimer suspend;
1676+
CoreSuspender suspend;
16771677
color_ostream_proxy out(Core::getInstance().getConsole());
16781678

16791679
df::unit *op_unit = getOperatorUnit(engine->bld, true);

plugins/stockflow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class LuaHelper {
116116
bool stockpile_method(const char *method, building_stockpilest *sp) {
117117
// Combines the select_order and toggle_trigger method calls,
118118
// because they share the same signature.
119-
CoreSuspendClaimer suspend;
119+
CoreSuspender suspend;
120120

121121
auto L = Lua::Core::State;
122122
color_ostream_proxy out(Core::getInstance().getConsole());
@@ -146,7 +146,7 @@ class LuaHelper {
146146
auto L = Lua::Core::State;
147147
color_ostream_proxy out(Core::getInstance().getConsole());
148148

149-
CoreSuspendClaimer suspend;
149+
CoreSuspender suspend;
150150
Lua::StackUnwinder top(L);
151151

152152
if (!lua_checkstack(L, 2))

0 commit comments

Comments
 (0)