Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gammasoft71/xtd
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Jan 9, 2025
2 parents b2fca9f + 60fb9d8 commit 5903417
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/// @file
/// @brief Contains #core_native_export_ keyword.
/// @copyright Copyright (c) 2024 Gammasoft. All rights reserved.
/// @copyright Copyright (c) 2025 Gammasoft. All rights reserved.
#pragma once

/// @brief Define shared library export.
Expand Down
5 changes: 3 additions & 2 deletions src/xtd.core.native.linux/src/xtd/native/linux/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ intmax_t thread::create(std::function<void(intmax_t)> start, intmax_t obj, int32
start_obj->first(start_obj->second);
delete start_obj;
return nullptr;
}, reinterpret_cast<void*>( new std::pair<std::function<void(intmax_t)>, intmax_t> {start, obj}));
}, reinterpret_cast<void*>(new auto(std::make_pair(start, obj))));
if (error != 0) return static_cast<intmax_t>(PTHREAD_FAILED);
// The POSIX standard provides no mechanism by which a thread A can suspend the execution of another thread B, without cooperation from B. The only way to implement a suspend/resume mechanism is to have B check periodically some global variable for a suspend request and then suspend itself on a condition variable, which another thread can signal later to restart B.
// POSIX does not support suspending a thread without its cooperation.
// A thread must periodically check a global variable and suspend itself on a condition variable.
id = static_cast<intmax_t>(thread);
return static_cast<intmax_t>(thread);
}
Expand Down

0 comments on commit 5903417

Please sign in to comment.