Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Different native pthread.h implementations
Re: Different native pthread.h implementations [message #30781 is a reply to message #30778] Sat, 22 January 2011 11:24 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
tojocky wrote on Sat, 22 January 2011 10:42


Maybe:
Thread::Id tid = Thread::GetCurrentId();

?


Then there are problems for thread_index Index container:
Web/socket.cpp: In function 'Upp::String& Upp::SockErrorText()':
Web/socket.cpp:824: error: invalid conversion from 'pthread*' to 'int'
Web/socket.cpp:824: error:   initializing argument 1 of 'int Upp::AIndex<T, V, HashFn>::Find(const T&)
const [with T = int, V = Upp::Vector<int>, HashFn = Upp::StdHash<int>]'
Web/socket.cpp:827: error: invalid conversion from 'pthread*' to 'int'
Web/socket.cpp:827: error:   initializing argument 1 of 'void Upp::AIndex<T, V, HashFn>::Add(const T&) 
[with T = int, V = Upp::Vector<int>, HashFn = Upp::StdHash<int>]'


You need to create GetHashValue function for this type, even if you declare Index like following:
static Index<Thread::Id> thread_index;


In other words, there is needed an value, not a pointer to it.

[Updated on: Sat, 22 January 2011 12:31]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Use same variable in different threads
Next Topic: XmlRpc: possible crash fixed
Goto Forum:
  


Current Time: Tue Aug 26 19:56:37 CEST 2025

Total time taken to generate the page: 0.08024 seconds