aboutsummaryrefslogtreecommitdiff
path: root/src/threading/mutex_auto_lock.h
Commit message (Collapse)AuthorAge
* Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot2017-06-06
| | | | * Fix event LINT & remove default constructor/destructors * remove compat code & modernize autolock header
* Fix C++11 Windows build of threading codesfan52016-10-06
| | | | | | | The initial problem was that mutex_auto_lock.h tries to use std::unique_lock<std::mutex> despite mutex.h not using C++11's std::mutex on Windows. The problem here is the mismatch between C++11 usage conditions of the two headers. This commit moves the decision logic to threads.h and makes sure mutex.h, mutex_auto_lock.h and event.h all use the same features.
* Fix C++11 compilabilityest312016-01-23
| | | | Previous commits broke it... :(
* Clean up threadingShadowNinja2015-08-23
* Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.
lass="hl opt">] = yard_id.." --"..info.yard_name.." Yard--" txt[#txt+1] = "Active: " .. tostring(F.indicator(info.active_indicator_pos)) txt[#txt+1] = "Direction: " .. tostring(F.indicator(info.dir_indicator_pos)) txt[#txt+1] = "Last Train: " .. tostring(S.known_trains[info.last_id] or info.last_id).." ("..tostring(info.arrival_length).."-"..tostring(info.departure_length)..")" txt2[#txt2+1] = "Time: "..tostring(rwt.to_string(info.arrival_time)).."+"..tostring(rwt.to_string(rwt.diff(info.arrival_time,info.departure_time))) digiline_send(yard_id.."_1",table.concat(txt,"\n")) txt2[#txt2+1] = "RTS: "..tostring(info.rts) txt2[#txt2+1] = "Error: ".. tostring(F.indicator(info.error_indicator_pos)) txt2[#txt2+1] = "" digiline_send(yard_id.."_2",table.concat(txt2,"\n")) local notifications = "" if info.notify then local nt = "" if getN(info.notify) > 0 then nt = "Notify: " for k in pairs(info.notify) do nt = nt..k..", " end else nt = "Notify: No Notifications" end local st_len = 26 if nt:len() > st_len then nt = nt:sub(1,st_len).."\n"..nt:sub(st_len+1) end notifications = nt else notifications = "Notify: Not Enabled" end digiline_send(yard_id.."_NOTIFY",notifications) return end