mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-10-01 12:23:22 +08:00
enhance code for some uninitialized fields
This commit is contained in:
@@ -601,18 +601,18 @@ static void reset_window (PMAINWIN pWin, RECT* rcWin)
|
||||
static inline void lock_zi_for_change (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_rwlock_wrlock(&zi->rwlock);
|
||||
zi->wrlock_owner = pthread_self();
|
||||
zi->rwlock_owner = pthread_self();
|
||||
}
|
||||
|
||||
static inline void unlock_zi_for_change (ZORDERINFO* zi)
|
||||
{
|
||||
pthread_rwlock_unlock(&zi->rwlock);
|
||||
zi->wrlock_owner = 0;
|
||||
zi->rwlock_owner = 0;
|
||||
}
|
||||
|
||||
static inline void lock_zi_for_read (ZORDERINFO* zi)
|
||||
{
|
||||
if (zi->wrlock_owner == pthread_self()) {
|
||||
if (zi->rwlock_owner == pthread_self()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ static inline void lock_zi_for_read (ZORDERINFO* zi)
|
||||
|
||||
static inline void unlock_zi_for_read (ZORDERINFO* zi)
|
||||
{
|
||||
if (zi->wrlock_owner == pthread_self()) {
|
||||
if (zi->rwlock_owner == pthread_self()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -245,6 +245,7 @@ int __kernel_alloc_z_order_info (int nr_topmosts, int nr_normals, BOOL with_mask
|
||||
#ifdef _MGRM_THREADS
|
||||
# ifdef __ZI_USE_RWLOCK
|
||||
pthread_rwlock_init(&__mg_zorder_info->rwlock, NULL);
|
||||
__mg_zorder_info->rwlock_owner = 0;
|
||||
# else
|
||||
do {
|
||||
int ret;
|
||||
|
||||
Reference in New Issue
Block a user