Hi, I'm trying to load my resources using a thread. But it isn't working yet. Here's my error output at the console:
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
after 88 requests (88 known processed) with 0 events remaining.
I'm using
Linux laptop 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:01 UTC 2014 i686 athlon i686 GNU/Linux, C++11, SFML2.1 and this as my example program:
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
sf::Texture tex;
void loadResources() {
tex.loadFromFile("tile.png");
}
int main() {
sf::RenderWindow window(sf::VideoMode(640, 480), "Demo");
sf::Thread thread(&loadResources);
thread.launch();
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
window.close();
}
}
}
return 0;
};
Porting to C++11's std::thread causes:
Failed to use the XRandR extension while trying to get the desktop video modes
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 186 ()
Minor opcode of failed request: 0
Serial number of failed request: 89
Current serial number in output stream: 90
Any ideas?
/EDIT: The output seems to vary from each start to another. Here is another one (using sf::Thread again)
X Error of failed request: BadIDChoice (invalid resource ID chosen for this connection)
Major opcode of failed request: 1 (X_CreateWindow)
Resource id in failed request: 0x3c0000b
Serial number of failed request: 88
Current serial number in output stream: 88
An yet another one:
[xcb] Unknown sequence number while processing queue
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
main: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.