Skip to content

Commit

Permalink
Merge pull request #384 from vibe-d/remove_lockedconnection_task_check
Browse files Browse the repository at this point in the history
Remove task check from LockedConnection.
  • Loading branch information
l-kramer authored Feb 9, 2024
2 parents 5525731 + bb6f916 commit a05716c
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions source/vibe/core/connectionpool.d
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ struct LockedConnection(Connection) {

private {
ConnectionPool!Connection m_pool;
Task m_task;
Connection m_conn;
debug uint m_magic = 0xB1345AC2;
}
Expand All @@ -253,15 +252,12 @@ struct LockedConnection(Connection) {
assert(!!conn);
m_pool = pool;
m_conn = conn;
m_task = Task.getThis();
}

this(this)
{
debug assert(m_magic == 0xB1345AC2, "LockedConnection value corrupted.");
if (!!m_conn) {
auto fthis = Task.getThis();
assert(fthis is m_task);
m_pool.m_lockCount[m_conn]++;
static if (is(typeof(cast(void*)conn)))
logTrace("conn %s copy %d", () @trusted { return cast(void*)m_conn; } (), m_pool.m_lockCount[m_conn]);
Expand All @@ -272,8 +268,6 @@ struct LockedConnection(Connection) {
{
debug assert(m_magic == 0xB1345AC2, "LockedConnection value corrupted.");
if (!!m_conn) {
auto fthis = Task.getThis();
assert(fthis is m_task, "Locked connection destroyed in foreign task.");
auto plc = m_conn in m_pool.m_lockCount;
assert(plc !is null);
assert(*plc != 0);
Expand Down

0 comments on commit a05716c

Please sign in to comment.