Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Мамедов Кенан Эльчин Оглы committed Sep 29, 2024
1 parent 63fc828 commit d771522
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"C_Cpp.default.compilerPath": ""
}
2 changes: 1 addition & 1 deletion include/TimedDoor.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 GHA Test Team
// Copyright 2024 MamedovKenan

#ifndef INCLUDE_TIMEDDOOR_H_
#define INCLUDE_TIMEDDOOR_H_
Expand Down
9 changes: 5 additions & 4 deletions src/TimedDoor.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright 2024 MamedovKenan
#include "../include/TimedDoor.h"

#include "TimedDoor.h"
#include <stdexcept>
#include <thread>
#include <chrono>
#include <thread> // NOLINT [build/c++11]
#include <chrono> // NOLINT [build/c++11]

DoorTimerAdapter::DoorTimerAdapter(TimedDoor& d) : door(d) {}

Expand Down Expand Up @@ -41,7 +42,7 @@ void TimedDoor::throwState() {
void Timer::tregister(int seconds, TimerClient* client) {
this->client = client;

std::thread([this, seconds]() {
std::thread([this, seconds, client]() {
sleep(seconds);
client->Timeout();
}).detach();
Expand Down

0 comments on commit d771522

Please sign in to comment.