cocos2d-x asynchronous update UI

Hi, all:
I need asynchronous update UI, the problem is that:
I use some iOS code to play a video, and when I playing the video, I notify the CCLayer to update CCProgressTimer. I can observe the function running, but the UI doesn’t update.
the code:

void DbVideoLayer::syncProgressBar(float p){
if(p>=0 && p<=1){
CCLog(“perc ……………………is f",p);
((CCSprite *)this->getChildByTag(PROGRESS_ICON_TAG))->setPositionInPixels(ccp(473-728/2.0f + 728*p, 768.0f-587.0f));
CCLog("perc location is…is f”,(473-728/2.0f + 728*p));
CCProgressTimer* progress = ((CCProgressTimer**)this~~>getChildByTag);
progress~~>setPercentage;
CCLog);
}
}
the I want to use update to update the UI, but I have another problem:
I use a member variable to store the percentage, see my update function:
void DbVideoLayer::syncProgressBar{
pthread_mutex_lock;
CCLog;
if {
mPrecetage = p;
}
CCLog;
pthread_mutex_unlock;
}
// update
void DbVideoLayer::update
{
pthread_mutex_lock;
if {
float p = mPrecetage;
CCLog;
if{
CCProgressTimer** progress = ((CCProgressTimer*)this~~>getChildByTag);
progress~~>setPercentage(p*100.0f);
}
CCLog(“##########################update per is %f”, mPrecetage);
}
pthread_mutex_unlock(&mutex);
}

my log:
Cocos2d: ##################sync Progress Bar: per:0.934126
Cocos2d: ………………sync Progress Bar: per:0.934126
Cocos2d: ##################sync Progress Bar: per:0.935261
Cocos2d: ………………sync Progress Bar: per:0.935261
Cocos2d: ##################sync Progress Bar: per:0.937124
Cocos2d: ………………………update per is 1.000000
Cocos2d: ##########################update per is
1.000000
Cocos2d: cocos2d: CCFileUtils: Warning file not found: du_bofang_1_699_632-ipad.png
Cocos2d: ………………………update per is 1.000000
Cocos2d: ##########################update per is
1.000000
Cocos2d: cocos2d: CCFileUtils: Warning file not found: du_bofang_2_701_631-ipad.png
Cocos2d: ………………………update per is 1.000000
Cocos2d: ##########################update per is
1.000000
Cocos2d: cocos2d: CCFileUtils: Warning file not found: du_bofang_1_699_632-ipad.png
Cocos2d: ………………………update per is 1.000000
Cocos2d: ##########################update per is
1.000000
Cocos2d: cocos2d: CCFileUtils: Warning file not found: du_bofang_1_699_632-ipad.png
Cocos2d: ………………………update per is 0.937124
Cocos2d: ##########################update per is 0.937124
Cocos2d: cocos2d: CCFileUtils: Warning file not found: du_bofang_2_701_631-ipad.png
Cocos2d: ………………sync Progress Bar: per:0.937124
Cocos2d: ##################sync Progress Bar: per:0.938309
Cocos2d: ………………sync Progress Bar: per:0.938309
Cocos2d: ##################sync Progress Bar: per:0.939385
Cocos2d: ………………sync Progress Bar: per:0.939385
Cocos2d: ##################sync Progress Bar: per:0.940386
Cocos2d: ………………sync Progress Bar: per:0.940386
Cocos2d: ##################sync Progress Bar: per:0.941433
Cocos2d: ………………sync Progress Bar: per:0.941433
Cocos2d: ##################sync Progress Bar: per:0.943064
Cocos2d: ………………………update per is 1.000000
Cocos2d: ##########################update per is
1.000000
Cocos2d: cocos2d: CCFileUtils: Warning file not found: du_bofang_1_699_632-ipad.png
Cocos2d: ………………………update per is 1.000000
Cocos2d: ##########################update per is
1.000000

I don’t know why the variable —mPrecetage— is –1.0f —this is init value;

thank you