Skip to content

Commit b4a1e20

Browse files
committed
Minify chances of crashing with new action queue
This does not really apply to bluewing-cpp-server as it's a single-threaded server. However, it is a significant edit. The main thread now queues things for the lacewing event pump to processs, if event pump is not being ticked in main thread. Only unhosting is a blocking action that freezes the main thread until action is processed; everything else is queued and processed later. This is now build 38 as MMF2Exts would have it (specifically, as SortaCore/MMF2Exts@d603e29 would have it). A few improvements will still happen to bluewing-cpp-server before build 38 is released here.
1 parent 887bcdc commit b4a1e20

File tree

2 files changed

+211
-34
lines changed

2 files changed

+211
-34
lines changed

Lacewing/Lacewing.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,13 +1694,11 @@ struct writelock {
16941694
#endif
16951695

16961696

1697-
1698-
16991697
struct relayclientinternal;
17001698
struct relayclient
17011699
{
17021700
public:
1703-
const static int buildnum = 101;
1701+
const static int buildnum = 104;
17041702

17051703
void * internaltag = nullptr, *tag = nullptr;
17061704

@@ -1924,7 +1922,7 @@ struct codepointsallowlist {
19241922
struct relayserverinternal;
19251923
struct relayserver
19261924
{
1927-
static const int buildnum = 34;
1925+
static const int buildnum = 38;
19281926

19291927
void * internaltag, * tag = nullptr;
19301928

@@ -2029,7 +2027,6 @@ struct relayserver
20292027
void channel_addclient(std::shared_ptr<relayserver::channel> channel, std::shared_ptr<relayserver::client> client);
20302028
void channel_removeclient(std::shared_ptr<relayserver::channel> channel, std::shared_ptr<relayserver::client> client);
20312029

2032-
20332030
struct client
20342031
{
20352032
friend relayserverinternal;
@@ -2065,7 +2062,7 @@ struct relayserver
20652062
clientimpl getimplementationvalue() const;
20662063
std::vector<std::shared_ptr<lacewing::relayserver::channel>> & getchannels();
20672064

2068-
void disconnect(int websocket_exit_code = 0);
2065+
void disconnect(std::shared_ptr<relayserver::client> cli = nullptr, int websocket_exit_code = 0);
20692066

20702067
void send(lw_ui8 subchannel, std::string_view data, lw_ui8 variant = 0);
20712068
void blast(lw_ui8 subchannel, std::string_view data, lw_ui8 variant = 0);

0 commit comments

Comments
 (0)