Merge branch 'rwlock' into devel

Conflicts:
	library/mobjects.c
Merge branch 'new-api' into devel