fixed datathread lock problem (issue #272)