Developing Libraries Using Software Transactional Memory