optimize thread lock on mips64
This commit is contained in:
parent
f27916d117
commit
6b0c7c6d06
|
@ -94,7 +94,7 @@ static inline unsigned int rpcc(void){
|
||||||
#define RPCC_DEFINED
|
#define RPCC_DEFINED
|
||||||
|
|
||||||
#ifndef NO_AFFINITY
|
#ifndef NO_AFFINITY
|
||||||
#define WHEREAMI
|
//#define WHEREAMI
|
||||||
static inline int WhereAmI(void){
|
static inline int WhereAmI(void){
|
||||||
int ret=0;
|
int ret=0;
|
||||||
__asm__ __volatile__(".set push \n"
|
__asm__ __volatile__(".set push \n"
|
||||||
|
|
|
@ -2587,20 +2587,20 @@ void *blas_memory_alloc(int procpos){
|
||||||
|
|
||||||
position = 0;
|
position = 0;
|
||||||
|
|
||||||
|
LOCK_COMMAND(&alloc_lock);
|
||||||
do {
|
do {
|
||||||
/* if (!memory[position].used) { */
|
/* if (!memory[position].used) { */
|
||||||
LOCK_COMMAND(&alloc_lock);
|
|
||||||
/* blas_lock(&memory[position].lock);*/
|
/* blas_lock(&memory[position].lock);*/
|
||||||
|
|
||||||
if (!memory[position].used) goto allocation;
|
if (!memory[position].used) goto allocation;
|
||||||
|
|
||||||
UNLOCK_COMMAND(&alloc_lock);
|
|
||||||
/* blas_unlock(&memory[position].lock);*/
|
/* blas_unlock(&memory[position].lock);*/
|
||||||
/* } */
|
/* } */
|
||||||
|
|
||||||
position ++;
|
position ++;
|
||||||
|
|
||||||
} while (position < NUM_BUFFERS);
|
} while (position < NUM_BUFFERS);
|
||||||
|
UNLOCK_COMMAND(&alloc_lock);
|
||||||
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue