Code review comment for lp:~vkolesnikov/pbxt/pbxt-bug-378222

Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

pushed the change

Paul McCullagh wrote:
> I think you could try: xt_use_table_no_lock()
>
> Because lock on db->db_tables is not required anyway.
>
> On Jun 16, 2009, at 12:18 PM, Vladimir Kolesnikov wrote:
>
>
>> This was my first idea too, but xt_use_table requires self-
>>
>>> st_database
>>>
>> to be inited which is done in xt_ue_database() so I put this code
>> right
>> after the call to xt_use_database (and xt_use_database itself doesn't
>> seem to be good place too). Of course I can copy some code from
>> xt_use_database and put it before the use_table but I thought it's
>> not a
>> good idea.
>>
>> Paul McCullagh wrote:
>>
>>> Hi Vlad,
>>>
>>> This patch looks good. Just one thing: how about doing this in
>>> xt_tab_init_db()?
>>>
>>> I think this would be more efficient.
>>>
>>> On Jun 12, 2009, at 4:40 PM, Vladimir Kolesnikov wrote:
>>>
>>>
>>>
>>>> === modified file 'src/database_xt.cc'
>>>> --- src/database_xt.cc 2009-05-28 15:17:16 +0000
>>>> +++ src/database_xt.cc 2009-06-12 14:29:30 +0000
>>>> @@ -616,7 +616,9 @@
>>>> xtPublic void xt_open_database(XTThreadPtr self, char *path, xtBool
>>>> multi_path)
>>>> {
>>>> XTDatabaseHPtr db;
>>>> -
>>>> + XTTableDescRec desc;
>>>> + XTPathStr table_path;
>>>> +
>>>> /* We cannot get a database, without unusing the current
>>>> * first. The reason is that the restart process will
>>>> * partially set the current database!
>>>> @@ -625,7 +627,18 @@
>>>> db = xt_get_database(self, path, multi_path);
>>>> pushr_(xt_heap_release, db);
>>>> xt_use_database(self, db, XT_FOR_USER);
>>>> - freer_(); // xt_heap_release(self, db);
>>>> +
>>>> + xt_describe_tables_init(self, db, &desc);
>>>> + pushr_(xt_describe_tables_exit, &desc);
>>>> + while (xt_describe_tables_next(self, &desc)) {
>>>> + xt_strcpy(PATH_MAX, table_path.ps_path, desc.td_tab_path-
>>>>
>>>>> tp_path);
>>>>>
>>>> + xt_add_dir_char(PATH_MAX, table_path.ps_path);
>>>> + xt_strcat(PATH_MAX, table_path.ps_path, desc.td_tab_name);
>>>> + xt_heap_release(self, xt_use_table(self, &table_path, FALSE,
>>>> FALSE, NULL));
>>>> + }
>>>> +
>>>> + freer_(); // xt_describe_tables_exit(self, desc);
>>>> + freer_(); // xt_heap_release(self, db);
>>>> }
>>>>
>>>>
>>>>
>>>
>>> --
>>> Paul McCullagh
>>> PrimeBase Technologies
>>> www.primebase.org
>>> www.blobstreaming.org
>>> pbxt.blogspot.com
>>>
>>>
>>>
>>>
>>>
>> --
>> --
>> Best Regards,
>> Vladimir
>>
>> https://code.launchpad.net/~vkolesnikov/pbxt/pbxt-bug-378222/+merge/
>> 7376
>> Your team PBXT Core is subscribed to branch lp:pbxt.
>>
>
>
>
> --
> Paul McCullagh
> PrimeBase Technologies
> www.primebase.org
> www.blobstreaming.org
> pbxt.blogspot.com
>
>
>
>

--
--
Best Regards,
Vladimir

« Back to merge proposal