Changeset 692

Show
Ignore:
Timestamp:
09/15/05 21:37:06 (3 years ago)
Author:
ehabkost
Message:

Fix Yet Another update_hash/report_success race. This time on knotes support

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/kdepim/src/knotes.cpp

    r475 r692  
    195195} 
    196196 
    197 bool KNotesDataSource::access(OSyncContext *ctx, OSyncChange *chg) 
     197/** basic access method 
     198 * 
     199 * This method is used by both access() and commit_change() method, 
     200 * so it shouldn't call osync_context_report_success(). On success, 
     201 * it should just return true and let the caller report success() to 
     202 * OpenSync 
     203 */ 
     204bool KNotesDataSource::__access(OSyncContext *ctx, OSyncChange *chg) 
    198205{ 
    199206        osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, ctx, chg); 
     
    277284    } 
    278285 
    279     osync_context_report_success(ctx); 
    280286        osync_trace(TRACE_EXIT, "%s", __func__); 
    281287    return true; 
     
    285291{ 
    286292        osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, ctx, chg); 
    287     if (!access(ctx, chg)) { 
     293    if (!__access(ctx, chg)) { 
    288294        osync_trace(TRACE_EXIT_ERROR, "%s: Unable to delete note", __func__); 
    289295                return false; 
    290296    } 
    291297    osync_hashtable_update_hash(hashtable, chg); 
     298        osync_context_report_success(ctx); 
    292299        osync_trace(TRACE_EXIT, "%s", __func__); 
    293300    return true; 
    294301} 
     302 
     303bool KNotesDataSource::access(OSyncContext *ctx, OSyncChange *chg) 
     304{ 
     305        osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, ctx, chg); 
     306        if (!__access(ctx, chg)) { 
     307                osync_trace(TRACE_EXIT_ERROR, "%s: Unable to delete note", __func__); 
     308                return false; 
     309    } 
     310        osync_context_report_success(ctx); 
     311        osync_trace(TRACE_EXIT, "%s", __func__); 
     312        return true; 
     313}