Changeset 063e0626 in mainline
- Timestamp:
- 2018-07-05T21:41:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a75f3e49
- Parents:
- 4fe4ea6
- git-author:
- Dzejrou <dzejrou@…> (2018-03-02 19:55:30)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:20)
- Location:
- uspace/lib/cpp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/thread.hpp
r4fe4ea6 r063e0626 34 34 #include <ostream> 35 35 36 extern "C" { 37 #include <fibril.h> 38 #include <fibril_synch.h> 39 } 40 36 41 namespace std 37 42 { 38 extern "C" {39 #include <fibril.h>40 #include <fibril_synch.h>41 }42 43 43 namespace aux 44 44 { … … 200 200 (*callable)(); 201 201 202 if (callable->detached()) // No thread owns the wrapper.202 if (callable->detached()) 203 203 delete callable; 204 204 -
uspace/lib/cpp/src/thread.cpp
r4fe4ea6 r063e0626 39 39 thread::~thread() 40 40 { 41 // TODO: Change this to std::terminate when implemented.42 41 if (joinable()) 43 42 { 44 if (joinable_wrapper_ && !joinable_wrapper_->detached()) 45 { 46 joinable_wrapper_->join(); 47 delete joinable_wrapper_; 48 } 43 // TODO: call std::terminate 44 } 49 45 50 // TODO: this crashes :( 51 /* fibril_teardown((fibril_t*)id_, false); */ 52 /* std::abort(); */ 53 } 46 if (joinable_wrapper_ && !joinable_wrapper_->detached()) 47 delete joinable_wrapper_; 54 48 } 55 49 … … 62 56 thread& thread::operator=(thread&& other) noexcept 63 57 { 58 if (joinable()) 59 { 60 // TODO: call std::terminate 61 } 62 64 63 id_ = other.id_; 65 64 other.id_ = fid_t{}; … … 80 79 void thread::join() 81 80 { 82 if (joinable _wrapper_)81 if (joinable() && joinable_wrapper_) 83 82 joinable_wrapper_->join(); 84 83 }
Note:
See TracChangeset
for help on using the changeset viewer.