Monthly Archives: September 2010

Back from hospital since Saturday morning; feeling a bit weak and find it hard to concentrate on things for a longer period because I still have problems to sleep properly during night. Hopefully that will get better once the stuff that is still up my nose gets removed.

This is potentially problematic. Why? Consider the extreme case of a function shutdown() which does something like this:

void shutdown(){
thread->stop();delete thread;}

void shutdown()
{
thread->stop();
delete thread;
}

Congratulations, you’ve just introduced a race condition. Why, you will ask? You’re waiting for the thread to end before deleting it, right?

No. And this has to do with the way Qt implements QThread::wait() which you should have probably used in the first place, if you really need this sort of functionality.

Qt hooks a pthread cleanup handler in the native thread which will call wakeAll() on a QWaitCondition stored inside the pimpl of QThread. And this pimpl – you might have guessed – is gone when you call delete.

Since Echofon cut off custom-built Firefoxes I was looking for a new twitter client. The only one matching my needs was Pino. Unfortunately since the mandatory activation of OAuth in twitter it stopped working. But: No fear! I hacked it to use librest which supports OAuth ootb. Currently it is a bit flaky (crashes at startup sometimes for no obvious reason) and there is no easy way to log in. It currently uses librest’s demo consumer keys which is probably not the most fortunate thing to do. I will request own credentials as soon as it runs more stable. Stay tuned for updates, I will push it to a public repository really soon.