sfml multithreading

I'm currently working on a CLI based audio player. But I'm having trouble with sfml's threading class.

I've privately inherited sf::Thread and overridden their virtual member function Run(). As I've done before and as the tutorial for using their libraries tells me to.

But this time around it's not executing the code in Run() when I start the thread.
Here is the class in question:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class input : private sf::Thread{ 
public:	
	int get_RetLevel();
	input();
	void startThread();
private:
	virtual void Run(){
		while(running){
			parse_Input();
		}
	}
	void parse_Input();
	int retLevel;
	bool running;
};


All relevant member functions:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void input::startThread(){
	Launch();
}


input::input(){
	running = true;
	retLevel = -1;
}
void input::parse_Input(){
	char ch = NULL;
	ch = std::cin.get();
	if(ch == 'P' || ch == 'p')
		retLevel = PAUSE_PLAY;
	if(ch == 'Q' || ch == 'q'){
		retLevel = QUIT;
		running = false;
	}
	return;
	
}


and my main function:
1
2
3
4
5
6
7
8
int main(int argc, char **argv){
	
	input *conioMain = new input;
	conioMain->startThread();
	
	return 0;

}


I've tried damn near eveyrthing and can't get any code withing Run() to execute...any suggestions?
Nevermind, I fixed it. The main thread was finishing before the input one could take an input...adding a sleep function that waited while the program was running fixed this.
Topic archived. No new replies allowed.