auto import from //depot/cupcake/@137055

This commit is contained in:
The Android Open Source Project 2009-03-02 22:54:33 -08:00 committed by Alex Ray
parent 3fec108e6c
commit c739660fb7
2 changed files with 14 additions and 6 deletions

View File

@ -1101,16 +1101,22 @@ struct ResTable_config
return false;
}
// Return true if 'this' can be considered a match for the parameters in
// Return true if 'this' can be considered a match for the parameters in
// 'settings'.
// Note this is asymetric. A default piece of data will match every request
// but a request for the default should not match odd specifics
// (ie, request with no mcc should not match a particular mcc's data)
// settings is the requested settings
inline bool match(const ResTable_config& settings) const {
if (imsi != 0) {
if (settings.mcc != 0 && mcc != 0
&& mcc != settings.mcc) {
if ((settings.mcc != 0 && mcc != 0
&& mcc != settings.mcc) ||
(settings.mcc == 0 && mcc != 0)) {
return false;
}
if (settings.mnc != 0 && mnc != 0
&& mnc != settings.mnc) {
if ((settings.mnc != 0 && mnc != 0
&& mnc != settings.mnc) ||
(settings.mnc == 0 && mnc != 0)) {
return false;
}
}

View File

@ -896,6 +896,7 @@ void ReadWriteLock::unlockForRead()
{
mLock.lock();
if (mNumReaders == 0) {
mLock.unlock();
LOG(LOG_WARN, "thread",
"WARNING: unlockForRead requested, but not locked\n");
return;
@ -961,6 +962,7 @@ void ReadWriteLock::unlockForWrite()
{
mLock.lock();
if (mNumWriters == 0) {
mLock.unlock();
LOG(LOG_WARN, "thread",
"WARNING: unlockForWrite requested, but not locked\n");
return;
@ -972,7 +974,7 @@ void ReadWriteLock::unlockForWrite()
//printf(" wrlk held %.3f msec\n",
// (double) mDebugTimer.durationUsecs() / 1000.0);
#endif
// mWriteWaiter.signal(); // should other writers get first dibs?
mWriteWaiter.signal(); // should other writers get first dibs?
//printf("+++ signaling readers (if any)\n");
mReadWaiter.broadcast(); // wake all readers (if any)
mLock.unlock();