mutex implementation

Need mutex implementation to share data among tasks.
1) consider about ARM ad 8051 processor.
2) consider about performance.