There are some unobvious dead lock problems caused by inappropriate acquiring and releasing resources among current transactions. At first, this paper analyzes the resource allocation problem caused by inappropriate usage of synchronization mechanism. Then it provides several ways to resolve this problem from different points. These ways can provide some directions to computer programmer and how to avoid resource allocation problem.